Skip to content

feat: follow wrapped Executor calls, open staged scripts, list runtime source builds - #8

Merged
bajrangCoder merged 1 commit into
mainfrom
feat/shell-check-evasions
Nov 10, 2026
Merged

bajrangCoder merged 1 commit into
mainfrom
feat/shell-check-evasions

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

Fixed

  • Command helpers are now followed when the Executor sink sits in a callback inside them, e.g. function exec(cmd) { return new Promise(r => Executor.start(cmd, ...)) }. Before this, every command passed to such a helper was lost, including curl ... | sh, and only a generic "built at runtime" finding was reported.
  • btoa(...) of a known string, and local base64 helpers that return btoa(...), now fold to their value.

Added

  • shell.encoded_script (Medium): base64 piped through base64 -d inside a command (printf %s <b64> | base64 -d > file, echo <b64> | base64 -d | sh) is decoded, and the decoded script gets the same checks as any command.
  • shell.staged_script (High): a file written with content the scanner can't read, then run with sh <file> from Executor or a terminal tab. The file's multi-line, script-shaped constants are checked as the likely content.
  • shell.builds_remote_source: git clone followed by a build step (make, cmake, npm install, cargo build, …), pip install git+…, and npm install github:….
    • The evidence lists each repository, and expands for R in a b c; do git clone …/$R fallback lists.
    • Medium when unpinned; Low when pinned (--branch <tag>, git checkout <sha>, pkg@<ref>).

Other

  • RULES_VERSION is bumped to 2026.11.4.
  • The README covers the new behaviour and rule IDs.

Tests

  • cargo test: 88 pass. New tests cover:
    • a Promise-wrapped helper
    • btoa and base64-helper folding
    • inline base64 decoding
    • hidden staged scripts, and the case where a written file is never run
    • pinned and unpinned source builds, including package-install forms
    • script-shaped constant detection
  • cargo clippy --all-targets is clean.
  • Before/after scans of three real plugin zips: two are unchanged; the third gains the expected staged_script and builds_remote_source findings, and its helper call sites are graded individually.

…e source builds

- Command helpers are followed when the Executor sink sits in a callback
  inside them (e.g. `new Promise(r => Executor.start(cmd, ...))`), so each
  call site is graded by its own command.
- `btoa(...)` and local base64 helpers that end in `btoa` are folded.
  Base64 piped through `base64 -d` in a command is decoded and checked
  (`shell.encoded_script`).
- New `shell.staged_script` (High): a file written with content the scanner
  can't read and then run with `sh <file>`. The file's script-shaped
  constants are checked as the likely content.
- New `shell.builds_remote_source`: `git clone` plus a build step,
  `pip install git+...` and `npm install github:...`, naming each repo
  (expanding `for R in ...` loops). Medium when unpinned, Low when pinned
  to a tag or commit.
- Bump rules version to 2026.11.4.
@bajrangCoder
bajrangCoder merged commit 28aed2f into main Nov 10, 2026
5 checks passed
@bajrangCoder
bajrangCoder deleted the feat/shell-check-evasions branch November 10, 2026 14:14
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