JS: include referer header as reflected XSS source

This commit is contained in:
Asger F
2018-10-04 10:53:10 +01:00
parent dc26bdc5e7
commit c2a5f99d9c
2 changed files with 5 additions and 0 deletions

View File

@@ -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() |

View File

@@ -47,6 +47,8 @@ module ReflectedXss {
class ThirdPartyRequestInputAccessAsSource extends Source {
ThirdPartyRequestInputAccessAsSource() {
this.(HTTP::RequestInputAccess).isThirdPartyControllable()
or
this.(HTTP::RequestHeaderAccess).getAHeaderName() = "referer"
}
}