fix(browser): keep declared scenario secrets out of redacted evidence (#1590)

A redaction marker such as [REDACTED:password] can contain the secret it replaced, and the byte replacer never scanned the marker it inserted. Cookie names, domains, paths, and storage keys were also stored raw. Choose a marker that does not contain a declared spelling, drop the result when a spelling remains, and redact storage identity fields.
This commit is contained in:
Adolanium
2026-10-11 06:22:57 +08:00
committed by GitHub
parent 1a6ccec636
commit 6edd5cf045
4 changed files with 202 additions and 46 deletions
+5 -5
View File
@@ -155,20 +155,20 @@ const captureStorage = async (input: {
);
const value = {
cookies: cookies.map((cookie) => ({
name: cookie.name,
domain: cookie.domain,
path: cookie.path,
name: secrets.redact(cookie.name),
domain: secrets.redact(cookie.domain),
path: secrets.redact(cookie.path),
secure: cookie.secure,
http_only: cookie.httpOnly,
same_site: cookie.sameSite,
...secrets.fingerprint(cookie.value),
})),
local_storage: pageStorage.local_storage.map(([name, value]) => ({
name,
name: secrets.redact(name),
...secrets.fingerprint(value),
})),
session_storage: pageStorage.session_storage.map(([name, value]) => ({
name,
name: secrets.redact(name),
...secrets.fingerprint(value),
})),
};