Skip to content

Commit 1ed0e8a

Browse files
committed
JS: Removed encodeURI from sanitizer list for xss and request forgery
1 parent 55eb9fb commit 1ed0e8a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

javascript/ql/lib/semmle/javascript/security/dataflow/RequestForgeryCustomizations.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ module RequestForgery {
106106
private import Xss as Xss
107107

108108
/**
109-
* A call to `encodeURI` or `encodeURIComponent`, viewed as a sanitizer for request forgery.
109+
* A call to `encodeURIComponent`, viewed as a sanitizer for request forgery.
110110
* These calls will escape "/" to "%2F", which is not a problem for request forgery.
111-
* The result from calling `encodeURI` or `encodeURIComponent` is not a valid URL, and only makes sense
111+
* The result from calling `encodeURIComponent` is not a valid URL, and only makes sense
112112
* as a part of a URL.
113113
*/
114114
class UriEncodingSanitizer extends Sanitizer instanceof Xss::Shared::UriEncodingSanitizer { }

javascript/ql/lib/semmle/javascript/security/dataflow/Xss.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ module Shared {
4747
}
4848

4949
/**
50-
* A call to `encodeURI` or `encodeURIComponent`, viewed as a sanitizer for
50+
* A call to `encodeURIComponent`, viewed as a sanitizer for
5151
* XSS vulnerabilities.
5252
*/
5353
class UriEncodingSanitizer extends Sanitizer, DataFlow::CallNode {
5454
UriEncodingSanitizer() {
5555
exists(string name | this = DataFlow::globalVarRef(name).getACall() |
56-
name in ["encodeURI", "encodeURIComponent", "escape"]
56+
name in ["encodeURIComponent", "escape"]
5757
)
5858
}
5959
}

0 commit comments

Comments
 (0)