mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
JS: include referer header as reflected XSS source
This commit is contained in:
@@ -412,6 +412,9 @@ module HTTP {
|
||||
*
|
||||
* In these cases, the request is technically sent from the user's browser, but
|
||||
* the user is not in direct control of the URL or POST body.
|
||||
*
|
||||
* Headers are never considered third-party controllable by this predicate, although the
|
||||
* third party does have some control over the the Referer and Origin headers.
|
||||
*/
|
||||
predicate isThirdPartyControllable() {
|
||||
exists (string kind | kind = getKind() |
|
||||
|
||||
@@ -47,6 +47,8 @@ module ReflectedXss {
|
||||
class ThirdPartyRequestInputAccessAsSource extends Source {
|
||||
ThirdPartyRequestInputAccessAsSource() {
|
||||
this.(HTTP::RequestInputAccess).isThirdPartyControllable()
|
||||
or
|
||||
this.(HTTP::RequestHeaderAccess).getAHeaderName() = "referer"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user