mirror of
https://github.com/github/codeql.git
synced 2026-01-31 07:12:57 +01:00
25 lines
765 B
Plaintext
25 lines
765 B
Plaintext
/**
|
|
* @name Code injection
|
|
* @description Interpreting unsanitized user input as code allows a malicious user to perform arbitrary
|
|
* code execution.
|
|
* @kind path-problem
|
|
* @problem.severity error
|
|
* @security-severity 9.3
|
|
* @sub-severity high
|
|
* @precision high
|
|
* @id py/code-injection
|
|
* @tags security
|
|
* external/cwe/cwe-094
|
|
* external/cwe/cwe-095
|
|
* external/cwe/cwe-116
|
|
*/
|
|
|
|
import python
|
|
import semmle.python.security.dataflow.CodeInjectionQuery
|
|
import DataFlow::PathGraph
|
|
|
|
from Configuration config, DataFlow::PathNode source, DataFlow::PathNode sink
|
|
where config.hasFlowPath(source, sink)
|
|
select sink.getNode(), source, sink, "$@ flows to here and is interpreted as code.",
|
|
source.getNode(), "A user-provided value"
|