mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
JS: whitelist quote stripping for js/incomplete-sanitization
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
| **Query** | **Expected impact** | **Change** |
|
||||
|--------------------------------|------------------------------|---------------------------------------------------------------------------|
|
||||
| Incomplete string escaping or encoding (`js/incomplete-sanitization`) | Fewer false-positive results | This rule now recognizes additional ways delimiters can be stripped away. |
|
||||
| Client-side cross-site scripting (`js/xss`) | More results | More potential vulnerabilities involving functions that manipulate DOM attributes are now recognized. |
|
||||
| Prototype pollution (`js/prototype-pollution`) | Same results | The results are now shown on LGTM by default. |
|
||||
|
||||
|
||||
@@ -122,6 +122,10 @@ predicate isDelimiterUnwrapper(
|
||||
left = "{" and right = "}"
|
||||
or
|
||||
left = "(" and right = ")"
|
||||
or
|
||||
left = "\"" and right = "\""
|
||||
or
|
||||
left = "'" and right = "'"
|
||||
|
|
||||
removesFirstOccurence(leftUnwrap, left) and
|
||||
removesFirstOccurence(rightUnwrap, right) and
|
||||
|
||||
@@ -192,3 +192,8 @@ app.get('/some/path', function(req, res) {
|
||||
var indirect = /'/;
|
||||
return s.replace(indirect, ""); // NOT OK
|
||||
});
|
||||
|
||||
(function (s) {
|
||||
s.replace('"', '').replace('"', ''); // OK
|
||||
s.replace("'", "").replace("'", ""); // OK
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user