📡Location Based Payloads

Location Based Payloads

The following XSS vectors use a more elaborated way to execute the payload making use of document properties to feed another document property, the location one.

That leads to complex vectors which can be very useful to bypass filters and WAFs. Because they use arbitrary tags (XHTML), any of the Agnostic Event Handlers seen before can be used. Here, “onmouseover” will be used as default.

Encode the plus sign (+) as %2B in URLs.

Location Basics

Simple Payloads

<svg/onload=location=‘javascript:alert(1)’>
<svg/onload=location=location.hash.substr(1)>#javascript:alert(1)

---------------------------------------------------------------

Location Basics

Vectors with simpler manipulation to achieve the redirection to javascript pseudo-protocol.

---------------------------------------------------------------

Location with URL Fragment

It’s required to use the vector with an unencoded # sign. If used in POST requests, URL fragments must be used in the action URL.

---------------------------------------------------------------

Location with Leading Alert

---------------------------------------------------------------

Location with Self URL

It’s required to replace [P} with the vulnerable parameter where input is used. Encode “&” as %26 in URLs. The last payload is Firefox only.

---------------------------------------------------------------

Location with Template Literal

---------------------------------------------------------------

Location-Based Payload - Javascript Keyword Evasion

---------------------------------------------------------------

Location Based Payloads

When a filter detects and blocks the XSS attempt in the parentheses in a payload,

Last updated