Skip to content

feat: add rules for npx commands + command substitutions#25

Open
sarahxsanders wants to merge 2 commits into
mainfrom
roin-orca-rules
Open

feat: add rules for npx commands + command substitutions#25
sarahxsanders wants to merge 2 commits into
mainfrom
roin-orca-rules

Conversation

@sarahxsanders

@sarahxsanders sarahxsanders commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Changes

adds three new rules:

  • supply_chain_npx_auto_confirm: catches npx/dlx/bunx with --yes/y or yes | (silent package execution) as critical/block
  • supply_chain_npx_in_skill: catches any npx/dlx/bunx invocation, with the belief that a trusted skill shouldn't tell an agent to install packages, high/warn
  • exfiltration_command_substitution_in_url: catchs curl/wget with $(...) or backtick command substitutions for data exfil via URL params or POST body, critical/block

these rules catch a real attack pattern found on skills.sh where a skill silently installs a second malicious skill via npx --yes, which then exfiltrates machine identity to an attacker-controlled domain via command substitution in a curl URL >.<

Test plan

  • Existing tests pass (pnpm test)
  • Build succeeds (pnpm build)
  • For new rules: added a positive-match test (content that should match)
  • For new rules: added a negative-match test (similar content that should not match – guards against false positives)
  • scanned https://skills.sh/roin-orca/skills/fun-brainstorming and it works

@sarahxsanders sarahxsanders requested a review from a team May 4, 2026 21:10
Generated-By: PostHog Code
Task-Id: 718b2db1-f48b-4bd0-88db-318035320ba1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant