Repository navigation
#4126: narrow disguised-executable detector, wired into census and worker - #4129
Merged
Merged
Conversation
… under inert extensions) Not yet wired into galaxyscope; see draft PR for status. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
…ed files with executable magic; structured aperture reason The Binary Analysis Sensor could not fire: galaxyscope's worker tested the aperture reason for wording Gate 1.3 no longer emits, and the census routed every denied-extension file to the unparsable list before any worker saw it. - aperture: ApertureReason (a str carrying .kind); Gate 1.3 returns kind DENIED_EXTENSION. The message text is unchanged for every log/report reader. - census (git and filesystem walk): a denied file whose first 8KB is an executable under an inert extension (security_lens.detect_disguised_executable: ELF, PE/NE/LE, self-consistent DOS MZ, Mach-O, Java class, wasm at offset 0) is dispatched -- stem_map/size only, not the language census or tallies. - worker: gates on reason.kind, calls detect_disguised_executable instead of scan_binary (kept for binary_anomaly_detector.py); threat_snippet stays out of the numeric equations. - signal_processor: the unreachable text-spoof branch and its test removed. - tests: detector cases, the reason's kind and pickling, and an end-to-end scan of planted files (ELF as .png and PE as .jpg fire; an LFS pointer, an empty .png and a png named .jpg do not). Measured: 0 of 98,228 denied-extension files flagged across 140 corpus-pool repos; golden crucible unchanged (zero-dependency passes; full-precision differs from main only by this machine's missing optional packages, identically on main). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
squid-protocol
marked this pull request as ready for review
October 3, 2026 04:10
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.
Fixes #4126
Problem
threat_extension_mismatchwas 0 everywhere because the Binary Analysis Sensor could not fire. Two disconnections:Restoring the old wide check (
scan_binary) would have flagged 10.5% of ordinary denied files: compressed images, LFS pointers, image-format mislabels.Change
security_lens.detect_disguised_executable()(narrow). Flags executable magic only at offset 0: ELF; PE verified through e_lfanew, plus NE/LE/LX; a self-consistent DOS MZ; Mach-O; Java class; wasm. It fires only under an extension that claims an inert format, so image aliasing, LFS pointers and empty files can't fire by construction.aperture: structured reason.ApertureReasonis astrcarrying.kind, and survives pickling. Gate 1.3 returnskind == DENIED_EXTENSION; the message text is unchanged.reason.kindand callsdetect_disguised_executableinstead ofscan_binary;scan_binarystays forbinary_anomaly_detector.py.threat_snippetstays out of the numericequations.signal_processor. The unreachable text-spoof branch and its test are removed;sec_extension_mismatchkeeps its slot..pngand a PE as.jpgfire; an LFS pointer, an empty.pngand a PNG named.jpgdon't.Measurement
/nvme-data/gitgalaxy-data, 140 repos), through the same census check: 0 of 98,228 denied-extension files flagged (79,423 with inert extensions). The oldscan_binary()flagged 10.5%.threat_extension_mismatch = 1,binary_anomaly = 1).tests/tools/pr_gates.py --fast: 5/5 (lint, audits, secrets, xray, gauntlet).Score impact
The signal feeds the hit_vector,
threat_extension_mismatch,binary_anomalyandfam_threat(display only). It's excluded from archetype features (thesec_prefix).is_malwareis unaffected, since it comes only from the XGBoost model, which isn't shipped. Each flag adds one synthetic artifact (impact 5000). Flags are 0 on the pool and on the crucible, so no golden change.🤖 Generated with Claude Code
https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ