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:
@@ -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),
|
||||
})),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user