You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
leaked-secrets: cap the stored length of a finding's value (a 1 MB password value is kept whole) #1592
The caps on security/leaked-secrets count findings, not bytes. A generic secret value has no length cap: scanPageForSecrets on an inline const password="<32 chars repeated 32000 times>"; keeps two records with 1,024,011-character values. A crawl of 100 such pages with distinct values stays far below every finding and page ceiling while retaining over 100 MB of value text. Found by an independent review of #1552's worst-case figures, which are now documented as estimates for ordinary-length values.
Acceptance Criteria
A finding's stored value is cut to a fixed maximum length (pick one with a measured reason; the match must still be recognisable and redacted the same way), and a cut value is marked as cut so a report reader can tell.
A test builds a page with a 1 MB secret-shaped value and asserts the retained record size is bounded by the cap, with an explicit timeout and no process-wide patches.
The docs worst-case figures for the collector (docs/rules/security/leaked-secrets.mdx) are re-derived from the cap and stop calling value text unbounded.
No true positive is dropped: a value over the cap is still reported (cut and marked), never skipped.
CHANGELOG [Unreleased] has a bullet; rule meta text changes are called out so the private rule catalog can be regenerated.
Hi! I'd like to pick this up. I have a fix ready: a finding's stored value is cut to 2,048 characters at the single construction point in scanInto (surrogate-safe via clampItemString), so page, external-script and decoded-blob scans are all covered. Classification still sees the full value, a cut value is marked with truncated: true in the check item meta, and length keeps the full length. Verified locally: the issue's 1 MB case now stores 2,048 characters, 4 new tests pass, and the full security suite passes (2,943 tests). Opening a PR now.
Activity
anhnt256 commentedon Nov 5, 2026
Hi! I'd like to pick this up. I have a fix ready: a finding's stored value is cut to 2,048 characters at the single construction point in scanInto (surrogate-safe via clampItemString), so page, external-script and decoded-blob scans are all covered. Classification still sees the full value, a cut value is marked with truncated: true in the check item meta, and length keeps the full length. Verified locally: the issue's 1 MB case now stores 2,048 characters, 4 new tests pass, and the full security suite passes (2,943 tests). Opening a PR now.
fix(rules): cap the stored length of a leaked-secret value squirrelsc…
fix(rules): cap the stored length of a leaked-secret value squirrelsc…
fix(rules): cap the stored length of a leaked-secret value squirrelsc…
fix(rules): cap the stored length of a leaked-secret value squirrelsc…
nc9 commentedon Nov 5, 2026
sure - thanks! will test locally in a moment
fix(rules): cap the stored length of a leaked-secret value #1592
fix(rules): cap the stored length of a leaked-secret value #1592
fix(rules): cap the stored length of a leaked-secret value #1592
fix(rules): cap the stored length of a leaked-secret value #1592
docs(rules): leaked-secrets worst case counts the copies of kept valu…