[HTAF4-213] [Pre-submission] XSS via arbitrary cookie name at the https://www2.██████/nssi/core/dot_stu_reg/Registration.aspx
A cookie name was reflected into the page without sanitisation, so a crafted cookie name containing script markup executed as script in the browser. An attacker could set such a cookie from a related subdomain and then redirect the victim to the vulnerable page, running script in the context of an authenticated site.
- Triaged in 5 days
- Fixed in 2.7 years
- Paid in 5 days
- Disclosed after 4.6 years
##Description
We identified XSS via cookie name on the https://www2.███████/nssi/core/dot_stu_reg/Registration.aspx endpoint.
The first cookie name is getting reflected on the page without sanitization:
█████
##POC (you can use Chrome Incognito mode for clear experiment)
To trigger XSS on the https://www2.██████████/nssi/core/dot_stu_reg/Registration.aspx we used XSS on the different .████.mil property, to set the cookie to the .███.mil which can be visible from the www2.████, and then do redirect to the vulnerable endpoint:
https://███████.███████.mil/kc/main/pop_up_frm.asp?loc=javascript:top[%27ev%27+%27al%27](atob(%27ZG9jdW1lbnQuY29va2llPSd6eno8c2NyaXB0PmFsZXJ0KGRvY3VtZW50LmRvbWFpbik8L3NjcmlwdD49enp6O3BhdGg9Lztkb21haW49LmFmLm1pbCc7IHdpbmRvdy50b3AubG9jYXRpb24uaHJlZiA9ICdodHRwczovL3d3dzIucGV0ZXJzb24uYWYubWlsL25zc2kvY29yZS9kb3Rfc3R1X3JlZy9SZWdpc3RyYXRpb24uYXNweCc7%27))
The plain payload:
document.cookie='zzz<script>alert(document.domain)</script>=zzz;path=/;domain=.████.mil'; window.top.location.href = 'https://www2.███████/nssi/core/dot_stu_reg/Registration.aspx';
The result: ██████████ Video: ████████
##Suggested fix We feel there is no need to reflect cookies, generic error message should be more than enough.
Impact
Reflected XSS. The https://www2.█████████/nssi/ has authenticated experience, such as login/registration/manage endpoints for courses users, and it can be used for interactions on their behalf.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Reflected XSS on a site with authenticated features, so script could perform actions on the victim's behalf; the report notes the exploit relied on a separate XSS on another subdomain to plant the cookie.
What the attacker needed
Script injection on a sibling subdomain; victim follows a crafted link; cookies shared across the parent domain
The fix
The page should not reflect cookie names at all and should show a generic error message instead.
How it was found
- Use a script injection on a different property in the same parent domain to set a cookie for that parent domain
- Give the cookie a name containing script markup so it is visible to the target host
- Redirect the victim to the vulnerable registration page
- The page reflects the cookie name and the script runs
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Websites store small pieces of data called cookies in your browser, and each cookie has a name. This page took a cookie name and printed it into the page without cleaning it, so a name containing code would run as code in the browser. Because the site has logged-in features, that code could act as the victim.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.