Sanitize hostname if there is a slash and a previous component

This commit is contained in:
Sauyon Lee
2020-04-02 00:58:09 -07:00
parent 4b3982154a
commit 4e5b17e18d

View File

@@ -55,6 +55,9 @@ private predicate concatenationHasHostnameSanitizingSubstring(StringOps::Concate
exists(StringOps::ConcatenationLeaf lf | lf = cat.getALeaf() |
lf.getStringValue().regexpMatch(".*([?#]|[^?#:/\\\\][/\\\\]).*|[/\\\\][^/\\\\].*")
or
lf.getStringValue() = "/" and
exists(lf.getPreviousLeaf())
or
hasHostnameSanitizingSubstring(lf.asNode())
)
}