mirror of
https://github.com/waybarrios/opencode-power-pack.git
synced 2026-11-19 02:16:19 +00:00
GitHub Actions prompt-injection audit, threat modeling, differential review, variant analysis, SARIF parsing, Semgrep/CodeQL scanning and rule authoring, and WooYun-derived web vuln methodology. Generalized semgrep's piolium-specific subagent references. Skill count 45 -> 55.
61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
rules:
|
|
- id: variant-taint-js
|
|
message: "Potential variant: user input flows to dangerous sink"
|
|
severity: ERROR
|
|
languages: [javascript, typescript]
|
|
mode: taint
|
|
|
|
pattern-sources:
|
|
# Express
|
|
- pattern: req.query.$PARAM
|
|
- pattern: req.body.$PARAM
|
|
- pattern: req.params.$PARAM
|
|
- pattern: req.cookies.$PARAM
|
|
# URL/Location
|
|
- pattern: window.location.$PROP
|
|
- pattern: document.location.$PROP
|
|
- pattern: location.search
|
|
- pattern: location.hash
|
|
|
|
pattern-sinks:
|
|
# Command injection
|
|
- pattern: child_process.exec($SINK, ...)
|
|
- pattern: child_process.execSync($SINK, ...)
|
|
- pattern: child_process.spawn($SINK, ...)
|
|
# Code execution
|
|
- pattern: eval($SINK)
|
|
- pattern: Function($SINK)
|
|
- pattern: setTimeout($SINK, ...)
|
|
- pattern: setInterval($SINK, ...)
|
|
# SQL
|
|
- pattern: $DB.query($SINK, ...)
|
|
- pattern: $DB.raw($SINK)
|
|
# XSS
|
|
- pattern: $EL.innerHTML = $SINK
|
|
- pattern: document.write($SINK)
|
|
|
|
pattern-sanitizers:
|
|
- pattern: parseInt($X, ...)
|
|
- pattern: encodeURIComponent($X)
|
|
- pattern: escape($X)
|
|
- pattern: $DB.escape($X)
|
|
|
|
paths:
|
|
exclude:
|
|
- "**/*.test.js"
|
|
- "**/*.spec.js"
|
|
- "**/test/**"
|
|
- "**/node_modules/**"
|
|
|
|
- id: variant-pattern-js
|
|
message: "Suspicious pattern matching known vulnerability"
|
|
severity: WARNING
|
|
languages: [javascript, typescript]
|
|
patterns:
|
|
- pattern-either:
|
|
- pattern: eval(...)
|
|
- pattern: Function(...)
|
|
- pattern: child_process.exec(...)
|
|
- pattern-not: eval("...")
|
|
- pattern-not: Function("...")
|