Repository navigation
fix(run_linter): refuse an option-shaped eslint path - #94
Conversation
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): fix(run_linter): refuse an option-shaped eslint path. Tiny Sweeper completed its review; deterministic results follow. Review snapshot
Completeness: Complete Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
Summary
run_linter's eslint branch passed the model-suppliedpathtonpx eslint --format compact <path>. It refused absolute paths and.., but not values that start with-. Sopath: "--output-file=pwned.txt"reached eslint as an option and could write a file, or change eslint's behavior in other ways, from a tool meant only for linting. #80 closed the same hole forread_diff'sbase.The eslint branch now refuses a
paththat starts with-(path must be a path, not an option), the same wayread_diffrefuses an option-shapedbase. No real lint target needs a leading-.Related issue
None.
API or behavior changes
run_linterwithlinter: "eslint"and apathstarting with-now returns an error and does not run eslint. Every other path behaves as before.Validation
Commands actually run, with their outcome:
cargo fmt --all -- --check:rustfmt --edition 2024on the touched files only.cargo clippy --all-targets --all-features -- -D warningswas left to CI.cargo build --all-targets --all-featureswas left to CI.cargo test --all-featureswas left to CI. Only theeslint_rejects*tests ran locally, withnpxtaken offPATHso the pre-fix run could not start a real eslint:eslint_rejects_an_option_shaped_pathbefore the fix failed: the path passed validation and the tool tried to spawnnpx(Err: No such file or directory). After the fix it passed, along with the existing absolute-path and traversal tests.Tests
filesystem/run_linter/mod_tests.rs::eslint_rejects_an_option_shaped_pathsends--output-file=pwned.txtas the path. The test expects an error that names the option, and expectspwned.txtnot to exist.Documentation
Not needed.
Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description