mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-07 22:19:08 +02:00
Submit login credentials URL-encoded and accept them only in that encoding, so AppSec can redact them
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -52,16 +52,18 @@ function App() {
|
||||
setError(null);
|
||||
setSubmitting(method);
|
||||
|
||||
const formData = new FormData();
|
||||
// URL-encoded, not FormData: the proxy only accepts credentials in this
|
||||
// encoding, the one it can redact before mirroring a request to AppSec.
|
||||
const body = new URLSearchParams();
|
||||
if (method === "password") {
|
||||
formData.append(methods.password!, value);
|
||||
body.append(methods.password!, value);
|
||||
} else {
|
||||
formData.append(methods.pin!, value);
|
||||
body.append(methods.pin!, value);
|
||||
}
|
||||
|
||||
fetch(globalThis.location.href, {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
body,
|
||||
redirect: "manual",
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
Reference in New Issue
Block a user