Skip to content

Commit 516fdf6

Browse files
committed
update stream pipe
1 parent c7a7594 commit 516fdf6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

javascript/ql/src/experimental/Security/CWE-522-DecompressionBombs/ReadableAdditionalStep.qll

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,30 @@ predicate readablePipeAdditionalTaintStep(DataFlow::Node pred, DataFlow::Node su
2525
pred = cn.getParameter(0).asSink() and
2626
succ = cn.getReturn().getMember("pipe").getParameter(0).asSink()
2727
)
28+
or
29+
// this step connect the a pipe parameter to the next parameter
30+
exists(API::Node cn, int i |
31+
i in [0 .. 10] and
32+
cn =
33+
[
34+
API::moduleImport("stream/promises").getMember("pipeline"),
35+
API::moduleImport("stream").getMember("pipeline")
36+
]
37+
|
38+
pred = cn.getParameter(i).asSink() and
39+
succ = cn.getParameter(i + 1).asSink()
40+
)
41+
or
42+
// this step connect the first pipe parameter to the next parameter
43+
exists(API::Node cn, int i |
44+
i in [1 .. 10] and
45+
cn =
46+
[
47+
API::moduleImport("stream/promises").getMember("pipeline"),
48+
API::moduleImport("stream").getMember("pipeline")
49+
]
50+
|
51+
pred = cn.getParameter(0).asSink() and
52+
succ = cn.getParameter(i).asSink()
53+
)
2854
}

0 commit comments

Comments
 (0)