File tree Expand file tree Collapse file tree 4 files changed +13
-16
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -2068,3 +2068,14 @@ class VarAccessBarrier extends DataFlow::Node {
2068
2068
)
2069
2069
}
2070
2070
}
2071
+
2072
+ /**
2073
+ * Holds if there is a path without unmatched return steps from `source` to `sink`.
2074
+ */
2075
+ predicate hasPathWithoutUnmatchedReturn ( SourcePathNode source , SinkPathNode sink ) {
2076
+ exists ( MidPathNode mid |
2077
+ source .getASuccessor * ( ) = mid and
2078
+ sink = mid .getASuccessor ( ) and
2079
+ mid .getPathSummary ( ) .hasReturn ( ) = false
2080
+ )
2081
+ }
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ module UnsafeHtmlConstruction {
38
38
// override to require that there is a path without unmatched return steps
39
39
override predicate hasFlowPath ( DataFlow:: SourcePathNode source , DataFlow:: SinkPathNode sink ) {
40
40
super .hasFlowPath ( source , sink ) and
41
- hasPathWithoutUnmatchedReturn ( source , sink )
41
+ DataFlow :: hasPathWithoutUnmatchedReturn ( source , sink )
42
42
}
43
43
44
44
override predicate isAdditionalTaintStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
Original file line number Diff line number Diff line change @@ -174,17 +174,4 @@ module UnsafeHtmlConstruction {
174
174
175
175
override string describe ( ) { result = "Markdown rendering" }
176
176
}
177
-
178
- /**
179
- * Holds if there is a path without unmatched return steps from `source` to `sink`.
180
- */
181
- predicate hasPathWithoutUnmatchedReturn (
182
- DataFlow:: SourcePathNode source , DataFlow:: SinkPathNode sink
183
- ) {
184
- exists ( DataFlow:: MidPathNode mid |
185
- source .getASuccessor * ( ) = mid and
186
- sink = mid .getASuccessor ( ) and
187
- mid .getPathSummary ( ) .hasReturn ( ) = false
188
- )
189
- }
190
177
}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import javascript
14
14
*/
15
15
module UnsafeShellCommandConstruction {
16
16
import UnsafeShellCommandConstructionCustomizations:: UnsafeShellCommandConstruction
17
- import UnsafeHtmlConstructionCustomizations
18
17
19
18
/**
20
19
* A taint-tracking configuration for reasoning about shell command constructed from library input vulnerabilities.
@@ -36,7 +35,7 @@ module UnsafeShellCommandConstruction {
36
35
// override to require that there is a path without unmatched return steps
37
36
override predicate hasFlowPath ( DataFlow:: SourcePathNode source , DataFlow:: SinkPathNode sink ) {
38
37
super .hasFlowPath ( source , sink ) and
39
- UnsafeHtmlConstruction :: requireMatchedReturn ( source , sink )
38
+ DataFlow :: hasPathWithoutUnmatchedReturn ( source , sink )
40
39
}
41
40
42
41
override predicate isAdditionalTaintStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
You can’t perform that action at this time.
0 commit comments