Skip to content

Commit 2712bf8

Browse files
committed
JS: Fix a bug in isSafeClientSideUrlProperty
1 parent bc04131 commit 2712bf8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

javascript/ql/lib/semmle/javascript/dataflow/TaintTracking.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ module TaintTracking {
255255
exists(StringSplitCall c |
256256
c.getBaseString().getALocalSource() =
257257
[DOM::locationRef(), DOM::locationRef().getAPropertyRead("href")] and
258-
c.getSeparator() = "?" and
258+
c.getSeparator() = ["?", "#"] and
259259
read = c.getAPropertyRead("0")
260260
)
261261
}

javascript/ql/test/library-tests/TaintedUrlSuffix/tst.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function t1() {
55

66
sink(href); // $ flow=tainted-url-suffix
77

8-
sink(href.split('#')[0]); // $ MISSING: flow=tainted-url-suffix SPURIOUS: flow=taint
8+
sink(href.split('#')[0]); // $ MISSING: flow=tainted-url-suffix
99
sink(href.split('#')[1]); // $ flow=taint
1010
sink(href.split('#').pop()); // $ flow=taint
1111
sink(href.split('#')[2]); // $ flow=taint

0 commit comments

Comments
 (0)