JS: Port UnsafeShellCommandConstruction

This commit is contained in:
Asger F
2023-10-05 09:26:09 +02:00
parent d08e4504ff
commit ba9edb4e54
4 changed files with 280 additions and 673 deletions

View File

@@ -15,10 +15,12 @@
import javascript
import semmle.javascript.security.dataflow.UnsafeShellCommandConstructionQuery
import DataFlow::PathGraph
import UnsafeShellCommandConstructionFlow::PathGraph
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink, Sink sinkNode
where cfg.hasFlowPath(source, sink) and sinkNode = sink.getNode()
from
UnsafeShellCommandConstructionFlow::PathNode source,
UnsafeShellCommandConstructionFlow::PathNode sink, Sink sinkNode
where UnsafeShellCommandConstructionFlow::flowPath(source, sink) and sinkNode = sink.getNode()
select sinkNode.getAlertLocation(), source, sink,
"This " + sinkNode.getSinkType() + " which depends on $@ is later used in a $@.",
source.getNode(), "library input", sinkNode.getCommandExecution(), "shell command"