mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
20 lines
656 B
Plaintext
20 lines
656 B
Plaintext
import javascript
|
|
|
|
module CommandLineFileNameConfig implements DataFlow::ConfigSig {
|
|
predicate isSource(DataFlow::Node source) {
|
|
DataFlow::globalVarRef("process").getAPropertyRead("argv").getAPropertyRead() = source
|
|
}
|
|
|
|
predicate isSink(DataFlow::Node sink) {
|
|
DataFlow::moduleMember("fs", "readFile").getACall().getArgument(0) = sink
|
|
}
|
|
|
|
predicate isBarrier(DataFlow::Node nd) { nd.(DataFlow::CallNode).getCalleeName() = "checkPath" }
|
|
}
|
|
|
|
module CommandLineFileNameFlow = TaintTracking::Global<CommandLineFileNameConfig>;
|
|
|
|
from DataFlow::Node source, DataFlow::Node sink
|
|
where CommandLineFileNameFlow::flow(source, sink)
|
|
select source, sink
|