mirror of
https://github.com/github/codeql.git
synced 2026-03-21 23:16:53 +01:00
JS: use ports to sharpen js/incomplete-url-substring-sanitization
This commit is contained in:
@@ -51,7 +51,7 @@ where
|
||||
name = "endsWith" and
|
||||
target.regexpMatch("(?i)\\.([a-z0-9-]+)(\\.[a-z0-9-]+)+")
|
||||
or
|
||||
// the trailing slash makes the prefix-check safe
|
||||
// the trailing port or slash makes the prefix-check safe
|
||||
(
|
||||
name = "startsWith"
|
||||
or
|
||||
@@ -61,6 +61,6 @@ where
|
||||
n.getIntValue() = 0
|
||||
)
|
||||
) and
|
||||
target.regexpMatch(".*/")
|
||||
target.regexpMatch(".*(:[0-9]+|/)")
|
||||
)
|
||||
select call, "'$@' may be at an arbitrary position in the sanitized URL.", substring, target
|
||||
|
||||
Reference in New Issue
Block a user