mirror of
https://github.com/github/codeql.git
synced 2026-03-23 07:56:54 +01:00
22 lines
764 B
Plaintext
22 lines
764 B
Plaintext
/**
|
|
* @name Database query built from user-controlled sources
|
|
* @description Building a database query from user-controlled sources is vulnerable to insertion of
|
|
* malicious code by the user.
|
|
* @kind problem
|
|
* @problem.severity error
|
|
* @precision high
|
|
* @id js/sql-injection
|
|
* @tags security
|
|
* external/cwe/cwe-089
|
|
*/
|
|
|
|
import javascript
|
|
import semmle.javascript.security.dataflow.SqlInjection
|
|
import semmle.javascript.security.dataflow.NosqlInjection
|
|
|
|
from DataFlow::Configuration cfg, DataFlow::Node source, DataFlow::Node sink
|
|
where (cfg instanceof SqlInjection::Configuration or
|
|
cfg instanceof NosqlInjection::Configuration) and
|
|
cfg.hasFlow(source, sink)
|
|
select sink, "This query depends on $@.", source, "a user-provided value"
|