fix(browser): exclude sensitive binary lengths from historical captures (#2477)

Co-authored-by: chAngE <172472630+chAng-L19@users.noreply.github.com>
This commit is contained in:
chAngE
2026-10-13 14:49:47 +08:00
committed by GitHub
co-authored by chAngE
parent ab62ee9dcf
commit 68ecf3df8c
4 changed files with 105 additions and 2 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ def project_record(state, secrets):
safe_bytes, credential_url = transport_value(value, path, transport_url)
content_base64 = base64.b64encode(value).decode("ascii")
digest = hashlib.sha256(value).hexdigest()
hidden = any(secret in value or secret in safe_bytes for secret in byte_secrets) or any(secret in content_base64 or secret in digest for secret in secrets)
hidden = any(secret in value or secret in safe_bytes for secret in byte_secrets) or any(secret in content_base64 or secret in digest or secret in str(len(value)) for secret in secrets)
safe_text = None
try:
safe_text = safe_bytes.decode("utf-8", errors="strict")