Skip to content

Epic: Broaden the GlassWorm-style worm detector — more languages, what it's after, harder to dodge #1171

Open

Description

@squid-protocol

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:

  1. Language coverage is thin. self_propagation only 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.
  2. 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.
  3. 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:

  1. Worms/droppers commonly also register themselves for persistence (shell profile files, cron,
    systemd, PowerShell $PROFILE, Windows Run registry key) — a "does it survive a reboot"
    signal distinct from self-copy or credential-targeting.
  2. 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

Sub-issues

Related:

Activity

  1. added
    enhancement
    epic
    appsec
    supply-chain
    on Aug 9, 2026
  2. added
    scope:frontier
    on Oct 16, 2026
  3. squid-protocol commented on Nov 18, 2026

    @squid-protocol
    OwnerAuthor

    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.

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

    appsecenhancementepicpriority: mediumscope:frontiersupply-chain

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions