Skip to content

Commit

Permalink
Rust: Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffw0 committed Nov 20, 2024
1 parent 758092b commit d828941
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions rust/ql/src/queries/security/CWE-089/SqlInjection.ql
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ module SqlInjectionConfig implements DataFlow::ConfigSig {
predicate isBarrier(DataFlow::Node barrier) { barrier instanceof SqlInjection::Barrier }
}

/**
* Detect taint flow of tainted data that reaches a SQL sink.
*/
module SqlInjectionFlow = TaintTracking::Global<SqlInjectionConfig>;

from SqlInjectionFlow::PathNode sourceNode, SqlInjectionFlow::PathNode sinkNode
Expand Down
2 changes: 1 addition & 1 deletion rust/ql/src/queries/security/CWE-089/SqlInjectionBad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ let unsafe_query = format!("SELECT * FROM people WHERE firstname='{remote_contro

let _ = conn.execute(unsafe_query.as_str()).await?; // BAD (arbitrary SQL injection is possible)

let _ = sqlx::query(unsafe_query.as_str()).fetch_all(&mut conn).await?; // $ BAD (arbitrary SQL injection is possible)
let _ = sqlx::query(unsafe_query.as_str()).fetch_all(&mut conn).await?; // BAD (arbitrary SQL injection is possible)

0 comments on commit d828941

Please sign in to comment.