Skip to content

X-Ray misses large encoded payloads, and its header check can pass by chance #7187

Closed

Description

@squid-protocol

Found by the first real-detector control for X-Ray (#7155). X-Ray (binary_anomaly_detector) is a required pre-gate step and a shipped tool. It reads every file type, unlike Vault Sentinel (#7179), but these claims don't hold on planted inert content, with nothing mocked.

Gaps

1. Long lines are never scanned. SecurityLens._armor empties any line of 250 or more characters before scanning, to protect the regexes from slow backtracking. So a base64 payload on one long line is never measured: measured entropy hits stop between 200 and 256 characters. Packed payloads are what the check is meant to catch. This applies to every pattern run on that text, including Vault Sentinel's secrets (#7179).

2. The header check is partly luck. MZ is searched for anywhere in the first 8 KB. Any file containing those two letters is flagged, and a dense payload can be caught by chance. Our first control fixture passed that way, and the entropy check had nothing to do with it: it was only found because breaking the entropy check changed nothing.

3. XOR loops aren't flagged. X-Ray prints "Obfuscated bitwise operations (XOR loops)" as a detection, but a plain XOR decode loop passes. bitwise_ops was 0 for it.

4. Only the first 8 KB is read. A payload after that is never seen.

5. Some bypassed types have no required header. An executable named .ico or .tar passes, because SecurityLens.MAGIC_BYTES has no entry for them. .json and .yml skip the entropy check by design.

Each gap is pinned as a strict expected failure in tests/security_auditing/test_xray_control.py, so fixing one flips that test until it moves to the caught list. Gaps 1 and 2 are the priority.

Why these aren't fixed in the control PR

SecurityLens feeds the engine's signals, so gaps 1, 2 and 3 can move scoring and golden masters. They need measuring first.

Plan

Activity

  1. added
    bug
    priority: high
    scope:core
    on Oct 30, 2026
  2. squid-protocol commented on Oct 30, 2026

    @squid-protocol
    OwnerAuthor

    Heads-up for workers: the fix for long payloads, the 8 KB limit and MZ matching anywhere is built and tested, on branch feat/xray-long-payloads, queued behind feat/vault-sentinel-widen. Please don't redo it. Still open after it lands: XOR loops aren't flagged, and .ico and .tar have no required header.

  3. squid-protocol commented on Oct 31, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host melek, lease renewed 2026-10-31T03:29Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.

  4. squid-protocol commented on Oct 31, 2026

    @squid-protocol
    OwnerAuthor

    Churn run 7187-20261031T0143Z (host melek) ended without a PR. plan approved, resumed as 7187-20261031T0145Z

  5. squid-protocol commented on Oct 31, 2026

    @squid-protocol
    OwnerAuthor

    All plan items are merged (#7199, #7209, #7234, #7242). Long lines, MZ-at-start, whole-file encoded runs, .ico/.tar headers and the XOR claim are done. Wording leftovers in github-action-readme.md:76 and docs/wiki/02-06-security-lens.md:33 are docs-only and recorded in #7242's sibling gaps.

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

    bugclaim:melekpriority: highscope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions