Skip to content

fix(vuln-poc-gate): a PoC must live in the PoC dir, and files it creates count as mutation - #1218

Merged
aaronjmars merged 3 commits into
mainfrom
fix/vuln-poc-gate-path-and-untracked
Oct 14, 2026
Merged

aaronjmars merged 3 commits into
mainfrom
fix/vuln-poc-gate-path-and-untracked

Conversation

@Svector-anu

Copy link
Copy Markdown
Collaborator

vuln-poc-gate.sh is the evidence gate for HIGH/CRITICAL findings, so what it accepts as a PoC matters. two ways around it:

  • the PoC path was checked against POC_DIR by a prefix match on the spelled path. $POC_DIR/../x.sh passed, and so did a link inside POC_DIR to a script elsewhere, so a script from outside the PoC dir ran and was recorded as the verifier.
  • command mode looked for target changes with git diff / git diff --cached, which cannot see a file the script creates. a PoC that wrote into the target checkout still came out verified.

changes (scripts/vuln-poc-gate.sh)

  • poc_file canonicalises the file's directory and POC_DIR (pwd -P), requires the file to sit under it, and refuses a file that is itself a link. both the command script and the foundry test file go through it, and the canonical path is what runs / is copied
  • command mode takes git status --porcelain --untracked-files=all before the run and compares it after, on top of the existing diff checks. files that were already untracked do not count; new ones fail the run as target-mutated (exit 21)

tests (test_vuln_poc_gate.sh): .. escape is refused and the script does not run; a link in the PoC dir is refused; a script behind a linked directory is refused; a PoC that creates an untracked file fails with exit 21; a pre-existing untracked file does not break verification. four of the five new checks fail on main (the pre-existing-file one is a guard that passes on both). the suite passes in full; shellcheck has nothing at error severity and scripts/lint-shell.sh is clean.

not covered

  • exit 0 alone still verifies a command-mode PoC. the gate cannot tell a real reproduction from exit 0; requiring the script to print a marker would make a careless PoC fail but not a deliberate one, and it changes what vuln-scanner writes, so i left it as a question for you.
  • the PoC still runs with the runner's HOME; on a runner that holds no credential files there this is low, but a laptop run could read them.
  • foundry mode still checks target changes with git diff only: forge writes cache/ and out/ into the checkout, so the untracked comparison would need an allowlist for those.
  • live_vuln_poc_gate.sh needs network and was not run.

Svector-anu and others added 3 commits October 14, 2026 00:56
…tes count as mutation

The gate checked the spelled path of the PoC against the PoC dir with a prefix
match, so $POC_DIR/../x.sh passed, and a link inside the dir to a script
elsewhere passed too. It now compares canonical directories and refuses a linked
file. Command mode checked the target for changes with git diff, which cannot
see a file the script creates, so a PoC that wrote into the target still
verified; it now compares the full status, untracked files included, before and
after the run.
…nk reason, untracked wording

- After the PoC runs, a HEAD that moved off the audited commit now fails as target-mutated (both modes), with a test.
- A symlinked script or test file reports script-is-symlink / test-file-is-symlink instead of outside-poc-dir.
- Comment now says the status check sees untracked, non-ignored files only.
- PoC env sets PYTHONDONTWRITEBYTECODE=1; SKILL.md tells the scanner to keep fixtures in a mktemp -d dir outside the clone.

Co-Authored-By: Claude <noreply@anthropic.com>
@aaronjmars
aaronjmars merged commit 7402636 into main Oct 14, 2026
6 checks passed
@aaronjmars
aaronjmars deleted the fix/vuln-poc-gate-path-and-untracked branch October 15, 2026 19:26
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.

2 participants