Skip to content

feat(scanner): generic Rust always-on matchers#72

Open
jotarios wants to merge 4 commits into
vercel-labs:mainfrom
jotarios:main
Open

feat(scanner): generic Rust always-on matchers#72
jotarios wants to merge 4 commits into
vercel-labs:mainfrom
jotarios:main

Conversation

@jotarios
Copy link
Copy Markdown

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 form Command::new("sh"|"bash"|"zsh"|"cmd"|"powershell"|"pwsh"). Bare Command::new( was dropped to avoid catching clap::Command::new(...).
  • rs-path-traversal (normal) — zip-slip / tar-slip class (CVE-2025-29787): Path::join / PathBuf::push combined with entry.name(), entry.path(), or header.path() on the same line.
  • rs-ssrf (normal) — reqwest / ureq / surf / isahc verb calls with format!/concatenated URLs, plus Url::parse(&format!(...)) and Request::builder().uri(&format!(...)). Method-call form requires a receiver token (client, http, reqwest, ureq, surf, isahc, web, api) so HashMap::get/cache.get no longer fire.
  • rs-tls-no-verify (precise) — danger_accept_invalid_certs(true), danger_accept_invalid_hostnames(true), rustls dangerous_configuration / DangerousClientConfig, hand-rolled impl [path::]ServerCertVerifier, openssl SslVerifyMode::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 test passes
  • pnpm lint passes
  • pnpm knip passes
  • If this adds a matcher: ran it against at least one real repo and confirmed the candidate count is sane

Notes for reviewer

jotarios added 4 commits May 11, 2026 01:44
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.
feat(scanner): generic Rust always-on matchers
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

@jotarios is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant