Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e4ef52

Browse files
author
Max Schaefer
committed
JavaScript: Rename a predicate in CommandInjection.qll.
1 parent f3239cb commit 4e4ef52

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

javascript/ql/src/Security/CWE-078/CommandInjection.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@ import semmle.javascript.security.dataflow.CommandInjection::CommandInjection
1717

1818
from Configuration cfg, DataFlow::Node source, DataFlow::Node sink, DataFlow::Node highlight
1919
where cfg.hasFlow(source, sink) and
20-
if cfg.isSink(sink, _) then cfg.isSink(sink, highlight) else highlight = sink
20+
if cfg.isSinkWithHighlight(sink, _) then
21+
cfg.isSinkWithHighlight(sink, highlight)
22+
else
23+
highlight = sink
2124
select highlight, "This command depends on $@.", source, "a user-provided value"

javascript/ql/src/semmle/javascript/security/dataflow/CommandInjection.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ module CommandInjection {
3737
* Holds if `sink` is a data flow sink for command-injection vulnerabilities, and
3838
* the alert should be placed at the node `highlight`.
3939
*/
40-
predicate isSink(DataFlow::Node sink, DataFlow::Node highlight) {
40+
predicate isSinkWithHighlight(DataFlow::Node sink, DataFlow::Node highlight) {
4141
sink instanceof Sink and highlight = sink
4242
or
4343
indirectCommandInjection(sink, highlight)
4444
}
4545

4646
override predicate isSink(DataFlow::Node sink) {
47-
isSink(sink, _)
47+
isSinkWithHighlight(sink, _)
4848
}
4949

5050
override predicate isSanitizer(DataFlow::Node node) {

0 commit comments

Comments
 (0)