Skip to content

Rust: Add command injection (CWE-078) and unsafe deserialization (CWE-502) queries - #22302

Open
lcmangalagiri wants to merge 1 commit into
github:mainfrom
lcmangalagiri:rust-cwe-078-502-experimental
Open

Rust: Add command injection (CWE-078) and unsafe deserialization (CWE-502) queries#22302
lcmangalagiri wants to merge 1 commit into
github:mainfrom
lcmangalagiri:rust-cwe-078-502-experimental

Conversation

@lcmangalagiri

Copy link
Copy Markdown

Summary
Add two new security queries for Rust, which currently has no experimental queries.

  1. Command Injection (CWE-078):

    • Detects user-controlled data flowing into std::process::Command and tokio::process::Command (both command name and arguments)
    • Includes models-as-data sinks for Command::new, .arg(), .args()
    • Query ID: rust/command-line-injection
  2. Unsafe Deserialization (CWE-502):

    • Detects user-controlled data flowing into deserialization functions (serde_json, bincode, rmp_serde, ciborium, serde_yaml, toml)
    • Query ID: rust/unsafe-deserialization

Both queries include:

  • Extension libraries with sources, sinks, and barriers
  • Query help (.qhelp) with examples
  • Test cases with inline expectations
  • Models-as-data sink definitions

…-502) queries

Add two new security queries for Rust:

1. Command Injection (CWE-078):
   - Detects user-controlled data flowing into std::process::Command and
     tokio::process::Command (both command name and arguments)
   - Includes models-as-data sinks for Command::new, .arg(), .args()
   - Query ID: rust/command-line-injection

2. Unsafe Deserialization (CWE-502):
   - Detects user-controlled data flowing into deserialization functions
     (serde_json, bincode, rmp_serde, ciborium, serde_yaml, toml)
   - Query ID: rust/unsafe-deserialization

Both queries include:
- Extension libraries with sources, sinks, and barriers
- Query help (.qhelp) with examples
- Test cases with inline expectations
- Models-as-data sink definitions
@lcmangalagiri
lcmangalagiri requested a review from a team as a code owner August 9, 2026 07:33
@github-actions github-actions Bot added documentation Rust Pull requests that update Rust code labels Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant