Skip to content

fix(plugin-quality): accept Windows saved= paths and require Write for the ledger - #6089

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/plugin-quality-windows-paths-e44b
Oct 3, 2026
Merged

cursor[bot] merged 2 commits into
mainfrom
cursor/plugin-quality-windows-paths-e44b

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Summary

collect-categories.sh treats a C:/ saved= path as inside the packet when it is the same file as the POSIX form Git Bash reports, and it names a corroborator URL that was already counted. The auditor writes every packet file with the Write tool.

Fix

  • When cygpath is on PATH, the ledger directory and each saved= path are converted with cygpath -u before realpath -m. Linux and macOS behavior is unchanged.
  • A duplicate corroborator URL prints research-corroborator-duplicate-url.
  • categories.md names both absolute forms. auditor.md forbids shell heredoc, cat >, tee, and cp into the packet.
  • plugin-quality 0.13.4.

Verification

bash -n and shellcheck on collect-categories.sh passed. collect-categories.test.sh passed. On this Linux host the inside-packet C:/ case skips visibly because cygpath is absent; the outside-packet C:/ case and the duplicate-URL case ran and passed. scripts/check-changelog-parity.sh --check, --check-order, and --check-bump origin/main passed.

Related

Closes #5942

Open in Web Open in Cursor 

…r the ledger

When cygpath is on PATH, convert the ledger directory and each saved= path
with cygpath -u before realpath -m, and name a corroborator URL that was
already counted. The auditor writes every packet file with the Write tool.

Co-authored-by: ksextonmelodic <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 3, 2026 16:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T16:14:06.059409Z 5a569cf Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 34s —— View job


Security review — no issues found

  • Gather context (PR diff, changed files)
  • Review collect-categories.sh changes for injection / path-handling issues
  • Review auditor.md instruction-surface changes
  • Review categories.md, test script, plugin.json, CHANGELOG
  • Check instruction-exception register for deleted/narrowed rules
  • Post findings

Scope: plugins/plugin-quality/skills/audit/scripts/collect-categories.sh, agents/auditor.md, categories.md, collect-categories.test.sh, plugin.json, CHANGELOG.md.

Primary attack surface examined: check_source() in collect-categories.sh builds shell command strings (cygpath -u -- '...' and realpath -m -- '...') from a saved=<path> value lifted out of audit-notes.md. That file is written by the auditor subagent while it reads a third-party plugin's own docs/skills, so the path text is reachable by adversarial content (prompt-injection-adjacent) in an audited plugin, which makes shell-metacharacter injection the thing to check here.

  • The new code (lines 96–111) escapes path into esc with the standard ' → '\'' single-quote escape before every shell interpolation, and critically re-escapes after each external capture: once before the cygpath call, and again on cygpath's stdout before it's embedded in the realpath call. Traced both branches:

    • cygpath_ok == 0: identical to the prior code path (esc escaped once, used directly in realpath -m -- '...').
    • cygpath_ok == 1 and the cygpath | getline esc succeeds: raw (unescaped) cygpath output is re-escaped before reuse — correct.
    • cygpath_ok == 1 and getline returns ≤0 (no output / error): esc is left holding the already-escaped value from the cygpath step (awk's getline var leaves var unchanged on failure), so the fallback realpath call still runs on a validly quoted form of the original string. No raw/unescaped value is ever spliced into a shell string.
    • Both commands pass -- before the path argument, so a path beginning with - can't be parsed as an option to cygpath/realpath.
    • The containment check (index(path, dir "/") != 1) still runs against the final realpath -m output in every branch, so a Windows-form path that fails conversion or resolves outside the packet is rejected the same way a POSIX ../ escape already is (covered by the new "a C:/ path outside the packet is rejected" test).

    No command-injection or path-traversal regression found in this logic.

  • auditor.md: the diff only adds restrictions (Write-tool-only for packet files; forbids heredoc/cat >/tee/cp into the packet) — it doesn't delete or soften any existing guardrail, so the instruction-exception-register lens (checked against docs/conventions/instruction-exception-register/README.md, present in this checkout) doesn't apply here. This change is a hardening, not a weakening: it reduces the auditor agent's reliance on Bash for writing attacker-influenceable content.

  • categories.md, collect-categories.test.sh: documentation and tests only, no security-relevant logic.

  • plugin.json, CHANGELOG.md: version bump and changelog entry, no security-relevant content.

GitHub Actions / zizmor-lane concerns and general code-quality items are out of scope for this lane and not covered here.

No CRITICAL, IMPORTANT, or SUGGESTION security findings.

@claude

claude Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 5m 41s —— View job


Code review complete

  • Gather context (PR diff, changed files)
  • Review collect-categories.sh changes (cygpath handling, duplicate-URL check)
  • Review auditor.md changes (Write-tool requirement)
  • Review categories.md doc update
  • Review test coverage in collect-categories.test.sh
  • Post findings

Ran /review:code-review (the CI code-review lane). Two findings posted as inline comments:

  1. plugins/plugin-quality/skills/audit/scripts/collect-categories.sh:74-80 — the new cygpath -u / realpath -m conversion of the ledger directory has no error check. Under set -uo pipefail (no -e), a failure of either command leaves DIR empty (confirmed locally: realpath -m -- '' exits 1 with empty stdout). An empty dir passed into the awk containment check at line 118 (index(path, dir "/") != 1) becomes a permanent no-op, since every resolved path starts with / — so the "outside the packet" rejection silently stops rejecting anything for the rest of the run. This path (cygpath present but failing on the ledger directory) is plausible on exactly the Windows path shapes this PR targets (UNC, substituted drives, long paths, OneDrive redirects). I traced this through the code and verified the realpath -m -- '' behavior directly, but couldn't exercise the full failure scenario end-to-end (a stub cygpath on PATH) since this review sandbox blocks mktemp/script execution — flagging as plausible, not execution-confirmed.
  2. plugins/plugin-quality/agents/auditor.md:36-37 — "Write has no 16384-character ceiling" is a new, uncited harness-behavior claim. The same file cites every comparable claim (model/effort pin, report-filename-guardrail paragraph) with a pointer, as-of date, and recheck trigger per .claude/rules/skill-bodies-state-current-rules.md and the repo's own Code Review Rules in AGENTS.md. This one states a specific numeric limit with none of that.

Everything else in the diff (the duplicate-corroborator-URL check, the categories.md wording, the version bump/CHANGELOG, and the new test cases) read correctly on inspection. The PR's own verification notes (shellcheck, bash -n, the test suite, check-changelog-parity.sh) are author-claimed and not independently re-run here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a569cf9eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

claude-security-review has reviewed this pull request through 5a569cf; a later push is reviewed from there.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

claude-review has reviewed this pull request through 5a569cf; a later push is reviewed from there.

A cygpath or realpath failure no longer clears the packet directory, which
would have let every absolute saved path pass the containment check. The
Write-only auditor line is dropped: one observed session is not the repeated
stumble a new standing instruction requires.

Co-authored-by: ksextonmelodic <[email protected]>
@cursor
cursor Bot merged commit 34f43f0 into main Oct 3, 2026
2 checks passed
@cursor
cursor Bot deleted the cursor/plugin-quality-windows-paths-e44b branch October 3, 2026 16: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.

fix(plugin-quality): accept C:/ saved= paths and write the auditor ledger only with Write

2 participants