Sample: Rust — see SquidGate detect findings - #8
Conversation
Demo only — hardcoded secret + injection / dangerous API patterns. See examples/README.md
🛡️ Security Scan ResultsThe diff adds a new demo file containing multiple high-severity injection vulnerabilities and a hardcoded secret. ⛔ 3 finding(s) block merge. HIGH — Hardcoded CredentialFile: A secret API key is hardcoded directly in the source code as a constant, exposing it to anyone with access to the repository or compiled binary. CWE: CWE-798 | OWASP: A07:2021 Recommendation: Remove the hardcoded value and load secrets from environment variables or a secure secrets manager (e.g., using std::env::var). HIGH — SQL Injection via String FormattingFile: User-controlled input 'id' is directly interpolated into a SQL query string using format!, enabling SQL injection attacks if this string is executed against a database. CWE: CWE-89 | OWASP: A03:2021 Recommendation: Use parameterized queries or prepared statements from the database driver (e.g., sqlx or diesel) instead of manual string concatenation. HIGH — OS Command InjectionFile: User input is concatenated into a shell command using format! and executed via sh -c, allowing arbitrary command execution. CWE: CWE-78 | OWASP: A03:2021 Recommendation: Avoid spawning shells with user input. Use Command::new with separate arguments (no -c) or validate/sanitize input if shell is unavoidable. |
SquidGate language sample — Rust
This PR intentionally introduces insecure patterns so you can see SquidGate work on Rust:
File
examples/rust/demo.rsWhat to look for
block_on(defaulthigh)All language samples · Setup SquidGate on your repo