Skip to content

Engine security pass is blind to lines of 250+ characters (secrets, signatures, entropy) #8429

Closed

Description

@squid-protocol

Part of #8427. Source: the security claims audit in #8426 (docs/security_claims_inventory.md, "Most serious problems" #3).

Problem

The engine's security pass cannot see any line of 250+ characters. SecurityLens._armor (gitgalaxy/security/security_lens.py:808-814) empties every line of 250 or more characters, as a ReDoS guard, before the regexes run. Reproduced in the #8426 audit: an AWS key alone on a line reads hardcoded_secrets: 1; the same key on a 300-character line reads nothing. Minified JS, long config values, single-line JSON and base64 blobs are exactly where payloads and secrets hide.

Entropy also scans the armored text, so string literals longer than about 248 characters are never entropy-checked. That contradicts "payloads hidden inside massive string literals" in gitgalaxy/security/README.md.

gitgalaxy/security/long_lines.py::chunk_long_lines already exists and is used only by vault_sentinel.py:20,153 (security.scan_content(chunk_long_lines(content)), with test_a_secret_on_a_long_line_fails). The engine pass does not use it. The blind spot is not in docs/known_blind_spots.md.

Class: every security consumer of scan_content and the armored text

Members to check at fix time (list from the authoritative source: callers of SecurityLens.scan_content / _armor and the THREAT_SIGNATURES registry at security_lens.py:309-640):

Member Reads long lines today? Status Evidence
Each THREAT_SIGNATURES key (13: high_risk_execution, state_mutation, ... see the dict) no, armored missing security_lens.py:309-640, :808-814
hardcoded_secrets (incl. credential_lexicon token formats) no, armored (reproduced) missing #8426 audit; security_lens.py:808-814
String-literal entropy (4.8 threshold, 64 to ~248 chars) no, reads armored text; literal extractor caps at 1024 missing security_lens.py:970
SBOM payload audit in sbom_recorder.py to verify: depends on whether it calls scan_content unverified gitgalaxy/recorders/sbom_recorder.py
--fail-on-secrets gate inherits the engine pass missing galaxyscope.py gate + test_cli_contract.py (planted secret is short)
Vault Sentinel yes, chunked handled vault_sentinel.py:153
X-Ray (binary_anomaly_detector.py, scan_binary 7.95 threshold, dense-run check) separate path, reads whole text up to 5 MB out of scope: not via _armor test_xray_control.py

Acceptance

  • Each member marked missing reads long lines through chunking (reuse chunk_long_lines), with no ReDoS regression: tests/security_auditing/test_redos_poison.py and test_security_lens.py::test_minified_fallback_* stay green, and add a poison case on a 300+ character line.
  • OR, for any member that cannot safely read long lines, the blind spot is written into docs/known_blind_spots.md and the docs that claim the capability are corrected.
  • A planted test per member on a 300+ character line, plus a near-miss.
  • Note performance and golden-master impact in the PR: chunking adds work on minified files, and findings will newly appear on goldens that contain long lines (rosetta:rebless-owed may apply). Run perf-ab for the scan-hot-path claim if the change touches the default path.

Related: Vault Sentinel fix #7179 / #7187 (X-Ray large payloads), both closed.

Activity

  1. added
    bug
    appsec
    vuln: secrets-leak
    threat: false-negative
    priority: high
    on Nov 13, 2026
  2. squid-protocol commented on Nov 18, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host nyx, lease renewed 2026-11-18T17:22Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:nyx label.

  3. squid-protocol commented on Nov 18, 2026

    @squid-protocol
    OwnerAuthor

    Acceptance met: hardcoded_secrets (#8603), one-line signatures (#8615) and string-literal entropy (#8622) now read lines of 250+ chars; SBOM recorder and --fail-on-secrets inherit; dead_code, homoglyphs and >1024-char literals are recorded in docs/known_blind_spots.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appsecbugclaim:nyxpriority: highthreat: false-negativevuln: secrets-leak

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions