mirror of
https://github.com/github/codeql.git
synced 2026-03-06 23:56:48 +01:00
In the CVSS calculator we model this by setting 'Attack Complexity' to High and 'User Interaction' to Low (as opposed to None). CVSS vector: CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:N
29 lines
1006 B
Plaintext
29 lines
1006 B
Plaintext
/**
|
|
* @name Indirect uncontrolled command line
|
|
* @description Forwarding command-line arguments to a child process
|
|
* executed within a shell may indirectly introduce
|
|
* command-line injection vulnerabilities.
|
|
* @kind path-problem
|
|
* @problem.severity warning
|
|
* @security-severity 6.3
|
|
* @precision medium
|
|
* @id js/indirect-command-line-injection
|
|
* @tags correctness
|
|
* security
|
|
* external/cwe/cwe-078
|
|
* external/cwe/cwe-088
|
|
*/
|
|
|
|
import javascript
|
|
import DataFlow::PathGraph
|
|
import semmle.javascript.security.dataflow.IndirectCommandInjectionQuery
|
|
|
|
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink, DataFlow::Node highlight
|
|
where
|
|
cfg.hasFlowPath(source, sink) and
|
|
if cfg.isSinkWithHighlight(sink.getNode(), _)
|
|
then cfg.isSinkWithHighlight(sink.getNode(), highlight)
|
|
else highlight = sink.getNode()
|
|
select highlight, source, sink, "This command depends on an unsanitized $@.", source.getNode(),
|
|
"command-line argument"
|