Skip to content

Commit bec1818

Browse files
committed
add taint through the normalize-url library
1 parent 86de10e commit bec1818

File tree

4 files changed

+303
-104
lines changed

4 files changed

+303
-104
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
lgtm,codescanning
22
* The security queries now track taint through more query string parsers.
33
Affected packages are
4-
[qs](https://npmjs.com/package/qs)
4+
[qs](https://npmjs.com/package/qs),
5+
[normailize-url](https://npmjs.com/package/normalize-url)

javascript/ql/src/semmle/javascript/frameworks/UriLibraries.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,18 @@ private class QsStep extends TaintTracking::SharedTaintStep {
279279
}
280280
}
281281

282+
/**
283+
* A taint step through a call to [normalize-url](https://npmjs.com/package/normalize-url)
284+
*/
285+
private class NormalizeUrlStep extends TaintTracking::SharedTaintStep {
286+
override predicate uriStep(DataFlow::Node pred, DataFlow::Node succ) {
287+
exists(API::CallNode call | call = API::moduleImport("normalize-url").getACall() |
288+
pred = call.getArgument(0) and
289+
succ = call
290+
)
291+
}
292+
}
293+
282294
/**
283295
* Provides steps for the `goog.Uri` class in the closure library.
284296
*/

0 commit comments

Comments
 (0)