feat(scanner): generic Rust always-on matchers#72
Open
jotarios wants to merge 4 commits into
Open
Conversation
Adds five always-on Rust matchers gated only on the `rust` tech tag, mirroring the existing Go always-on set. Rust matchers up to now were all framework-gated (axum, actix, rocket, …), so libraries and non-web services with a Cargo.toml got no Rust coverage at all. - rs-command-injection: std::process::Command, tokio::process::Command, and shell-interpreter forms. - rs-path-traversal: zip-slip / tar-slip — Path::join / PathBuf::push combined with entry.name(), entry.path(), header.path(), or a zip/ tar/archive identifier on the same line. - rs-ssrf: reqwest / ureq / hyper / surf / isahc with formatted or concatenated URLs, Url::parse(&format!(...)), Request::builder() .uri(&format!(...)). - rs-tls-no-verify: danger_accept_invalid_certs / hostnames, rustls dangerous_configuration, hand-rolled ServerCertVerifier, openssl SslVerifyMode::NONE. - rs-untrusted-deserialization: bincode, rmp_serde, serde_json:: from_reader, ciborium, postcard — no built-in size limits.
Replaces the "dedicated matchers are roadmap" note in the Rust section with a framework-gated list plus a Generic Rust (`rust`) subsection, mirroring the shape of the Generic Go (`go`) entry.
…/ rs-command-injection
feat(scanner): generic Rust always-on matchers
|
@jotarios is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Adds 5 generic always-on Rust matchers, mirroring the existing Go always-on set (go-command-injection, go-ssrf, …). All five are gated on tech: ["rust"] so they only run on detected-Rust repos. Tests/examples dirs are skipped.
New matcher slugs
rs-command-injection(precise) —std::process::Command::new,tokio::process::Command::new,process::Command::new, and the shell-interpreter formCommand::new("sh"|"bash"|"zsh"|"cmd"|"powershell"|"pwsh"). BareCommand::new(was dropped to avoid catchingclap::Command::new(...).rs-path-traversal(normal) — zip-slip / tar-slip class (CVE-2025-29787):Path::join/PathBuf::pushcombined withentry.name(),entry.path(), orheader.path()on the same line.rs-ssrf(normal) —reqwest/ureq/surf/isahcverb calls withformat!/concatenated URLs, plusUrl::parse(&format!(...))andRequest::builder().uri(&format!(...)). Method-call form requires a receiver token (client,http,reqwest,ureq,surf,isahc,web,api) soHashMap::get/cache.getno longer fire.rs-tls-no-verify(precise) —danger_accept_invalid_certs(true),danger_accept_invalid_hostnames(true), rustlsdangerous_configuration/DangerousClientConfig, hand-rolledimpl [path::]ServerCertVerifier, opensslSslVerifyMode::NONE.rs-untrusted-deserialization(normal) — binary/streaming deserializers without explicit size limits:bincode::deserialize/decode_from_slice/decode_from_std_read,rmp_serde::from_slice/from_read,serde_json::from_reader,ciborium::from_reader,postcard::from_bytes. The AI processor disambiguates internal-trust-boundary callsites.Why
I tested against a project in Rust (i.e., chasquimq, a Rust message broker) and got 0 results in 246 files. Today every Rust matcher is framework-gated (axum, actix, rocket, warp, tide, poem, tonic, lambda-rs), so libraries and non-web services that have a Cargo.toml but no web-framework dependency get effectively zero Rust coverage. These five fill that gap.
Verification
pnpm testpassespnpm lintpassespnpm knippassesNotes for reviewer