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 {
20682068 )
20692069 }
20702070}
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 {
3838 // override to require that there is a path without unmatched return steps
3939 override predicate hasFlowPath ( DataFlow:: SourcePathNode source , DataFlow:: SinkPathNode sink ) {
4040 super .hasFlowPath ( source , sink ) and
41- hasPathWithoutUnmatchedReturn ( source , sink )
41+ DataFlow :: hasPathWithoutUnmatchedReturn ( source , sink )
4242 }
4343
4444 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 {
174174
175175 override string describe ( ) { result = "Markdown rendering" }
176176 }
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- }
190177}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import javascript
1414 */
1515module UnsafeShellCommandConstruction {
1616 import UnsafeShellCommandConstructionCustomizations:: UnsafeShellCommandConstruction
17- import UnsafeHtmlConstructionCustomizations
1817
1918 /**
2019 * A taint-tracking configuration for reasoning about shell command constructed from library input vulnerabilities.
@@ -36,7 +35,7 @@ module UnsafeShellCommandConstruction {
3635 // override to require that there is a path without unmatched return steps
3736 override predicate hasFlowPath ( DataFlow:: SourcePathNode source , DataFlow:: SinkPathNode sink ) {
3837 super .hasFlowPath ( source , sink ) and
39- UnsafeHtmlConstruction :: requireMatchedReturn ( source , sink )
38+ DataFlow :: hasPathWithoutUnmatchedReturn ( source , sink )
4039 }
4140
4241 override predicate isAdditionalTaintStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
You can’t perform that action at this time.
0 commit comments