Skip to content

Commit c2a5f99

Browse files
committed
JS: include referer header as reflected XSS source
1 parent dc26bdc commit c2a5f99

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

javascript/ql/src/semmle/javascript/frameworks/HTTP.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ module HTTP {
412412
*
413413
* In these cases, the request is technically sent from the user's browser, but
414414
* the user is not in direct control of the URL or POST body.
415+
*
416+
* Headers are never considered third-party controllable by this predicate, although the
417+
* third party does have some control over the the Referer and Origin headers.
415418
*/
416419
predicate isThirdPartyControllable() {
417420
exists (string kind | kind = getKind() |

javascript/ql/src/semmle/javascript/security/dataflow/ReflectedXss.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ module ReflectedXss {
4747
class ThirdPartyRequestInputAccessAsSource extends Source {
4848
ThirdPartyRequestInputAccessAsSource() {
4949
this.(HTTP::RequestInputAccess).isThirdPartyControllable()
50+
or
51+
this.(HTTP::RequestHeaderAccess).getAHeaderName() = "referer"
5052
}
5153
}
5254

0 commit comments

Comments
 (0)