mirror of
https://github.com/github/codeql.git
synced 2026-01-30 06:42:57 +01:00
Add comment for new url concatenation sanitizer
This commit is contained in:
@@ -55,6 +55,8 @@ private predicate concatenationHasHostnameSanitizingSubstring(StringOps::Concate
|
||||
exists(StringOps::ConcatenationLeaf lf | lf = cat.getALeaf() |
|
||||
lf.getStringValue().regexpMatch(".*([?#]|[^?#:/\\\\][/\\\\]).*|[/\\\\][^/\\\\].*")
|
||||
or
|
||||
// this deals with cases such as `Sprintf("%s/%s", hostname, taint)`, which should be safe as
|
||||
// long as `hostname` is not user-controlled
|
||||
lf.getStringValue() = "/" and
|
||||
exists(lf.getPreviousLeaf())
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user