mirror of
https://github.com/github/codeql.git
synced 2026-03-05 23:26:51 +01:00
27 lines
988 B
Plaintext
27 lines
988 B
Plaintext
/**
|
|
* @name Unsafe code constructed from library input
|
|
* @description Using externally controlled strings to construct code may allow a malicious
|
|
* user to execute arbitrary code.
|
|
* @kind path-problem
|
|
* @problem.severity warning
|
|
* @security-severity 6.1
|
|
* @precision medium
|
|
* @id js/unsafe-code-construction
|
|
* @tags security
|
|
* external/cwe/cwe-094
|
|
* external/cwe/cwe-079
|
|
* external/cwe/cwe-116
|
|
*/
|
|
|
|
import javascript
|
|
import semmle.javascript.security.dataflow.UnsafeCodeConstruction::UnsafeCodeConstruction
|
|
import UnsafeCodeConstructionFlow::PathGraph
|
|
|
|
from
|
|
UnsafeCodeConstructionFlow::PathNode source, UnsafeCodeConstructionFlow::PathNode sink,
|
|
Sink sinkNode
|
|
where UnsafeCodeConstructionFlow::flowPath(source, sink) and sinkNode = sink.getNode()
|
|
select sink.getNode(), source, sink,
|
|
"This " + sinkNode.getSinkType() + " which depends on $@ is later $@.", source.getNode(),
|
|
"library input", sinkNode.getCodeSink(), "interpreted as code"
|