Skip to content

Commit 75f0a7f

Browse files
committed
Rust: Add summary query rust/summary/query-sinks.
1 parent 4ed4f68 commit 75f0a7f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* @name Query Sinks
3+
* @description Lists query sinks that are found in the database. Query sinks are flow sinks that
4+
* are used as possible locations for query results. Cryptographic operations are
5+
* excluded (see `rust/summary/cryptographic-operations` instead).
6+
* @kind problem
7+
* @problem.severity info
8+
* @id rust/summary/query-sinks
9+
* @tags summary
10+
*/
11+
12+
import rust
13+
import codeql.rust.dataflow.DataFlow
14+
import codeql.rust.security.SqlInjectionExtensions
15+
import Stats
16+
17+
/**
18+
* Gets a kind of query for which `n` is a sink (if any).
19+
*/
20+
string getAQuerySinkKind(DataFlow::Node n) {
21+
(n instanceof SqlInjection::Sink and result = "SqlInjection")
22+
}
23+
24+
from DataFlow::Node n
25+
select n, "sink for " + strictconcat(getAQuerySinkKind(n), ", ")

0 commit comments

Comments
 (0)