-
Notifications
You must be signed in to change notification settings - Fork 97
Quote mapper-generated validation command arguments #110
Copy link
Copy link
Open
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1Urgent regression or broken agent/channel workflow affecting real users now.Urgent regression or broken agent/channel workflow affecting real users now.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.This issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
Some mapper-generated validation commands interpolate repo-controlled paths, package names, task names, or test paths directly into shell command strings. Those commands are later executed through the validation path with
shell: true, so a project path or package name containing shell metacharacters can be interpreted as command syntax instead of a literal argument.Evidence
Examples on current
main:src/mappers/projects.ts:204buildspnpm --dir ${packageRoot} ${script}.src/mappers/projects.ts:212buildsnpm --prefix ${packageRoot} run ${script}.src/mappers/shared.ts:369andsrc/mappers/shared.ts:377do the same for shared Node script commands.src/mappers/turbo.ts:129-137interpolates Turbo task/filter values directly.src/mappers/rust.ts:92interpolates a crate member path intocargo test --manifest-path.src/mappers/swift.ts:177andsrc/mappers/swift.ts:217interpolate nested Swift package roots intoswift test --package-path.src/mappers/elixir.ts:304interpolates a test path intomix test.src/app.ts:1076-1078runs feature validation commands after fix.src/exec.ts:20-28executes command strings withshell: true.Reproduction idea
A workspace package under a path such as:
can produce a validation command shaped like:
When that string is executed by a shell,
touch INJECTEDis no longer just part of the package path. The same class of issue can happen with Turbo filters/package names and other mapper-generated command arguments.Expected behavior
Mapper-generated validation commands should treat repo-derived paths, task names, package names, and test paths as literal command arguments. A weird but valid path should either be safely quoted or rejected before it reaches shell execution.
Possible fix
Use the existing shell quoting helper for dynamic command arguments before assembling validation command strings. At minimum this should cover Node package roots/scripts, Turbo task/filter values, Rust manifest paths, Swift package roots, and Elixir test paths.
Regression coverage should include:
;;$()