JavaScript: Teach IncompleteSanitization to flag incomplete path sanitizers.

This commit is contained in:
Max Schaefer
2019-11-15 12:25:47 +00:00
parent b39bcde31c
commit 5565be14fc
3 changed files with 8 additions and 0 deletions

View File

@@ -166,6 +166,9 @@ where
// URL encoder
repl.getArgument(1).getStringValue().regexpMatch(urlEscapePattern)
)
or
// path sanitizer
(m = ".." or m = "/.." or m = "../" or m = "/../")
) and
// don't flag replace operations in a loop
not DataFlow::valueNode(repl.getReceiver()) = DataFlow::valueNode(repl).getASuccessor+() and