Repository navigation
Description
Why
#1150 built the first version of a GlassWorm-style worm detector: two narrow signals in
security_lens.py (unicode_steganography for invisible-payload hiding, self_propagation for
a file copying/overwriting itself), feeding the obfuscation_flag column (PR #1169). Deliberately
scoped narrow to avoid false positives.
Working through it surfaced a real gap and two natural extensions:
- Language coverage is thin.
self_propagationonly fires for JS/TS and Python. Worse: the
pattern already accepts PHP/Ruby's__FILE__self-reference token as a valid match target, but
no PHP/Ruby copy/write function names are paired with it in the alternation — that half of the
pattern is dead code today, matching nothing. - The detector only looks at how a worm spreads, never what it's after. GlassWorm and
similar campaigns steal specific, well-known credential files (npm tokens, SSH keys, cloud
credentials, browser wallet extension data) to fund propagation and profit. There's currently no
signal for "this code is reaching for a known secret file," which is a distinct and arguably
stronger indicator than the self-copy mechanic alone. - The self-copy pattern is intentionally strict and misses realistic variants. It only matches
when the self-reference token is the literal, immediate first argument to a copy/write call.
Two common, equally-worm-like shapes slip through untouched: wrapping the token in a
path-normalization call first (shutil.copy(os.path.abspath(__file__), dest)), and the
read-then-write two-call shape (fs.writeFileSync(dest, fs.readFileSync(__filename))).
Two further extensions surfaced during design discussion but need their own scoping:
- Worms/droppers commonly also register themselves for persistence (shell profile files, cron,
systemd, PowerShell$PROFILE, WindowsRunregistry key) — a "does it survive a reboot"
signal distinct from self-copy or credential-targeting. - Some info-stealers dump the entire environment/config wholesale rather than reading one known
credential file — a stronger but noisier signal that needs a real design pass before committing
to a pattern (see New signal (needs design pass): bulk environment/secret dump, gated on a nearby network sink #1176).
Finally: gitgalaxy/security/README.md already understates what's shipped (it doesn't mention the
worm-detection capability at all, and its "13 distinct threat categories" count will go stale the
moment any sub-issue here adds a new signature key) — the docs need to close that gap once the
rest of the epic lands.
Scope
This epic covers extensions to the source-code-level, per-file lexical signals in
security_lens.py only — same constraints as #1150 (regex-based, AST-free, no cross-file
execution tracing, no manifest/registry correlation). Each sub-issue must independently verify
zero unintended hits across the full language-crucible corpus before its golden-master rebless,
same discipline as PR #1169.
Explicitly out of scope for this epic: CI/CD workflow self-modification (e.g. a GitHub Actions
YAML file getting edited to leak secrets — the real-world pattern behind the tj-actions and
Ultralytics incidents). That's a config/manifest-parsing problem (guidestar_lens.py territory),
not a source-code lexical-signature problem, and deserves its own epic rather than being bolted on
here.
Reference docs
- obfuscation_flag / GlassWorm-style detector: needs a real design decision, not a code fix #1150 — the original design-decision issue and precedent for scope discipline on this detector.
- PR feat(security): build a narrow GlassWorm-style detector for obfuscation_flag #1169 — the initial
unicode_steganography/self_propagationimplementation, corpus
verification methodology, and golden-master rebless process to replicate for each sub-issue. gitgalaxy/security/security_lens.py— where all ofTHREAT_SIGNATURESlives.gitgalaxy/standards/how_to_add_a_language.md— the 16 numbered ReDoS/boundary-correctness
engine rules any new regex here must follow.
Sub-issues
- Extend self_propagation language coverage: fix dead PHP/Ruby token, add PowerShell + Shell #1172 — Extend
self_propagationlanguage coverage: fix the dead PHP/Ruby__FILE__
pairing, add PowerShell and Shell - New signal: credential/token-file targeting (what a worm is actually after) #1173 — New signal: credential/token-file targeting (what a worm is actually after),
correlated with the existing taint-tracking sink logic - Harden self_propagation matching: tolerate path-normalization wrappers and read-then-write shape #1174 — Harden
self_propagationmatching: tolerate path-normalization wrappers and the
read-then-write shape - New signal: persistence / auto-run registration (surviving a reboot) #1175 — New signal: persistence / auto-run registration (surviving a reboot)
- New signal (needs design pass): bulk environment/secret dump, gated on a nearby network sink #1176 — (Good First Issue, needs its own design pass) Bulk environment/secret dump signal,
gated on a nearby network sink - Update docs to reflect the broadened GlassWorm-style worm detector #1177 — Update docs (
gitgalaxy/security/README.md) to reflect everything above — should
land last, once the signal work has actually merged
Related:
- obfuscation_flag / GlassWorm-style detector: needs a real design decision, not a code fix #1150 — original design-decision issue (CLOSED via PR feat(security): build a narrow GlassWorm-style detector for obfuscation_flag #1169)
Activity
squid-protocol commentedon Nov 18, 2026
Frozen 2026-11-18 (owner): Worms Armageddon is closed and its open work moved to Gap Atlas, mapped but not built. These signals need a malware corpus and a crucible that do not exist, and regex worm signals are a space where GitGalaxy has no measured edge yet. They may return as inputs to a release-vs-own-history study if that study pans out.