mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Merge pull request #11959 from erik-krogh/ssrfSan
JS: add encodeURIComponent as a sanitizer for request-forgery
This commit is contained in:
@@ -81,4 +81,14 @@ module RequestForgery {
|
||||
|
||||
override string getKind() { result = "endpoint" }
|
||||
}
|
||||
|
||||
private import Xss as Xss
|
||||
|
||||
/**
|
||||
* A call to `encodeURI` or `encodeURIComponent`, viewed as a sanitizer for request forgery.
|
||||
* These calls will escape "/" to "%2F", which is not a problem for request forgery.
|
||||
* The result from calling `encodeURI` or `encodeURIComponent` is not a valid URL, and only makes sense
|
||||
* as a part of a URL.
|
||||
*/
|
||||
class UriEncodingSanitizer extends Sanitizer instanceof Xss::Shared::UriEncodingSanitizer { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user