Skip to content

security: every one-line signature reads lines of 250+ chars in chunks (Part of #8429) - #8615

Merged
squid-shepherd[bot] merged 3 commits into
mainfrom
churn/8429-20261118T1537Z
Nov 18, 2026
Merged

squid-shepherd[bot] merged 3 commits into
mainfrom
churn/8429-20261118T1537Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #8429 (slice 2 of 3, after #8603).

What

SecurityLens._armor empties every line of 250+ characters. #8603 re-read those lines in overlapping 200-character pieces for hardcoded_secrets only. This slice does the same for every other one-line THREAT_SIGNATURES key: the loop in scan_content now walks the scan plan, reads the code stream for CODE_STREAM_SIGNALS, honours prose and the high_risk_execution language scope, and merges counts, snippets, sites and positions. A hit seen in two pieces counts once.

Class / Sibling gaps

Class: every THREAT_SIGNATURES key on a line of 250+ characters (13 keys). Handled here: reflection_metaprogramming, safety_bypasses, io, high_risk_execution, state_mutation, bitwise_ops, shadow_imports, db_hooks, unicode_steganography, self_propagation (each with a planted case, a near-miss and a chunk-overlap case in test_security_lens.py), plus hardcoded_secrets (#8603).
Documented as blind spots in docs/known_blind_spots.md (not chunked): dead_code (reads comment text the code stream blanks), homoglyphs (needs the whole line to judge a script).
Sibling gaps (slice 3 / not here): string-literal entropy over literals longer than ~248 chars (slice 3); --fail-on-secrets CLI test with a long-line secret (slice 3); SBOM payload audit in sbom_recorder.py (unverified whether it calls scan_content); a match longer than the 200-character piece is still missed; the minified nine-literal fallback and the piece scan can both count the same literal (documented).

ReDoS, performance, goldens

  • Each piece is under the armor limit, so each regex stays bounded. Added per-signature poison cases on long lines (5 s CPU cap, tests/_timing.py); test_redos_poison.py and test_minified_fallback_* stay green.
  • A file with no 250+ character line pays one splitlines() pass; files with long lines now run the 11 regexes over pieces (work grows linearly with line length). Not A/B-measured with perf-ab.
  • Golden masters: see the ratchet result in the report below.

Gates

pr_gates --fast: lint, audits PASS. tests/security_auditing 1064 passed (numpy-free selfscan venv; test_security_auditor needs the full extra in the doom-ci venv). 226 other lens-touching tests passed.

Remaining slices

Slice 3: entropy over long literals; --fail-on-secrets CLI test with a long-line secret (tests/.../test_cli_contract.py); verify SBOM payload audit.

Lessons for agents

  • heavy-run.sh python tests/tools/pr_gates.py --fast takes over 9 minutes: use bg-job.sh start then bg-job.sh wait (a foreground timeout 580 is killed with exit 143).

Co-Authored-By: Claude Sonnet 5.5 [email protected]

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 18, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 18, 2026 16:23
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #8615 @ 23ea2bd: 2 failed check(s)

== crucible-audit (full-precision) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/44346716486/job/134950951478
repro: tests/tools/box/golden-lock.sh python tests/tools/pr_gates.py --only golden
failing tests: tests/test_golden_crucible.py::test_golden_crucible_matches_baseline
errors:
⚠️ MISMATCH at /12. Scan Output Snapshots/LLM Brief: Expected ['# ARCHITECTURAL_BRIEF: data', '> INSTRUCTION: Deterministic Syntactic Analysis. Base architectural insights on Structural Magnitude, Extracted Signatures, and Risk overlays.',
FAILED tests/test_golden_crucible.py::test_golden_crucible_matches_baseline - Failed: Structural drift detected against golden_master_audit (3 differences):
##[error]Process completed with exit code 1.
log tail:
│   ├── gitgalaxy
│   ├── github-action-readme.md
│   ├── mkdocs.yml
│   ├── muninn.yml
│   ├── pyproject.toml
│   ├── scripts
│   ├── site
│   ├── templates
│   ├── tests
│   └── zizmor.yml
└── language-crucible
├── AGENTS.md
├── ANTIGRAVITY.md
├── CLAUDE.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASING.md
├── SECURITY.md
├── SOURCES.md
├── data
├── raw_output
└── tools
14 directories, 25 files
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/ee741b18-69aa-45f6-b65a-27871467b048' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

== crucible-audit (zero-dependency) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/44346716486/job/134950952070
repro: tests/tools/box/golden-lock.sh python tests/tools/pr_gates.py --only golden
failing tests: tests/test_golden_crucible.py::test_golden_crucible_matches_baseline
errors:
⚠️ MISMATCH at /12. Scan Output Snapshots/LLM Brief: Expected ['# ARCHITECTURAL_BRIEF: data', '> INSTRUCTION: Deterministic Syntactic Analysis. Base architectural insights on Structural Magnitude, Extracted Signatures, and Risk overlays.',
2026-11-18 16:24:18,735 [WARNING] [GalaxyScope] ┃ (--fail-on-malware cannot fire). Rule-based threats still run. ┃
FAILED tests/test_golden_crucible.py::test_golden_crucible_matches_baseline - Failed: Structural drift detected against golden_master_zero_dep_audit (3 differences):
##[error]Process completed with exit code 1.
log tail:
│   ├── gitgalaxy
│   ├── github-action-readme.md
│   ├── mkdocs.yml
│   ├── muninn.yml
│   ├── pyproject.toml
│   ├── scripts
│   ├── site
│   ├── templates
│   ├── tests
│   └── zizmor.yml
└── language-crucible
├── AGENTS.md
├── ANTIGRAVITY.md
├── CLAUDE.md
├── LICENSE
├── NOTICE
├── README.md
├── RELEASING.md
├── SECURITY.md
├── SOURCES.md
├── data
├── raw_output
└── tools
14 directories, 25 files
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.1
Temporarily overriding HOME='/home/runner/work/_temp/75a8fc69-1a86-43c4-a3c5-010e3d0748cf' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Nov 18, 2026
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 18, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (f6ce3a6) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft November 18, 2026 16:45
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Nov 18, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Nov 18, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 18, 2026 16:46
@squid-shepherd squid-shepherd Bot added the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Nov 18, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 18, 2026 16:47
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot removed the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Nov 18, 2026
@squid-shepherd
squid-shepherd Bot merged commit e8d000f into main Nov 18, 2026
113 of 145 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/8429-20261118T1537Z branch November 18, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant