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