Repository navigation
security: hardcoded_secrets reads lines of 250+ characters (Part of #8429) - #8603
Merged
Merged
Conversation
… of #8429) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
Contributor
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #8429 (security epic #8427). First slice:
hardcoded_secretsreads lines of 250+ characters.What changed
SecurityLens.scan_content(gitgalaxy/security/security_lens.py) re-reads each line of 250+ characters in overlapping pieces (long_lines.CHUNK/OVERLAP, the same sizes Vault Sentinel uses) for thehardcoded_secretssignature only. Each piece is under the armor limit, so the regex stays bounded. Counts, snippets,positionsandsitescarry the ORIGINAL file's line and column. A value seen by two overlapping pieces counts once (span overlap).docs/known_blind_spots.mdandgitgalaxy/security/README.mdnow say secrets read long lines and everything else still does not.tests/security_auditing/test_security_lens.py): a planted AWS key at the start, middle and end of lines of 250, 300, 449 and 1000 characters (count, line, column); a near-miss (value under the 16-character floor); the chunk-overlap case (counted once); a poisoned 5 KB+ line bounded by CPU time (tests/_timing.py).Class / Sibling gaps
Class: every security consumer of
SecurityLens._armoroutput, which blanks lines of 250+ characters. Handled here:hardcoded_secrets(the credential lexicon and token formats share one regex). Vault Sentinel was already handled (chunked).Sibling gaps (not done here; different mechanism or risk, listed rather than filed):
THREAT_SIGNATURESkeys (high_risk_execution,io,state_mutation, ...): still blind on long lines.test_minified_fallback_mass_threshold_evasionpins that forhigh_risk_execution; chunking them would split multi-token patterns and shift golden counts, so each needs its own look.sbom_recorder.py: unverified whether it callsscan_content.--fail-on-secretsgate: inherits this fix for secrets; no CLI-level test with a long-line secret yet.Remaining slices
docs/known_blind_spots.md),test_security_lens.py+security_lens.py.--fail-on-secretswith a 300+ character line (test_cli_contract.py).No detection-effectiveness claim is made: this only makes the existing
hardcoded_secretsregex run on text it previously never saw.Performance and golden impact
Extra work only on lines of 250+ characters (one
finditerper 120 characters of such a line); files with no long line pay onelen()per line.crucible_check.py(both legs,golden-lock.sh): full_precision PASS, zero_dependency PASS, so no golden changed. Noperf-abrun; the default path is untouched for files without long lines.Gates
pr_gates.py --fast: 9/9 pass.pytest tests/security_auditing: 901 passed.pr_gates.py --ratchets: cics-spec, ports, port-surface, estate, det-mutation, time PASS. fact-crosscheck, completeness and ground-truth FAIL on this box because a mainframe corpus is not fetched at its pinned ref (example-health-apis); not rerun against main, and the change touches no COBOL path. CI is the check for these.Lessons for agents
None.
🤖 Generated with Claude Code