mirror of
https://github.com/github/codeql.git
synced 2026-03-26 01:08:16 +01:00
31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
/**
|
|
* For internal use only.
|
|
*
|
|
* @name SQL database query built from user-controlled sources (experimental)
|
|
* @description Building a database query from user-controlled sources is vulnerable to insertion of
|
|
* malicious code by the user.
|
|
* @kind path-problem
|
|
* @scored
|
|
* @problem.severity error
|
|
* @security-severity 8.8
|
|
* @id js/ml-powered/sql-injection
|
|
* @tags experimental security
|
|
*/
|
|
|
|
import experimental.adaptivethreatmodeling.SqlInjectionATM
|
|
import ATM::ResultsInfo
|
|
import DataFlow::PathGraph
|
|
|
|
from
|
|
DataFlow::Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink, float score,
|
|
string scoreString
|
|
where
|
|
cfg.hasFlowPath(source, sink) and
|
|
not isFlowLikelyInBaseQuery(source.getNode(), sink.getNode()) and
|
|
score = getScoreForFlow(source.getNode(), sink.getNode()) and
|
|
scoreString = getScoreStringForFlow(source.getNode(), sink.getNode())
|
|
select sink.getNode(), source, sink,
|
|
"[Score = " + scoreString + "] This may be a js/sql result depending on $@ " +
|
|
getAdditionalAlertInfo(source.getNode(), sink.getNode()), source.getNode(),
|
|
"a user-provided value", score
|