Cross-Site Scripting (XSS) in ASP.NET via ResolveUrl on ██████████
An ASP.NET application using the ResolveUrl method failed to sanitise user-controlled input, allowing an attacker to inject JavaScript that executes in a victim's browser. The attacker could steal session cookies and impersonate legitimate users.
Originally disclosed on HackerOne
- Triaged in 4 hours
- Fixed in 3 months
- Disclosed after 8 months
Description: Hi, team! A Cross-Site Scripting (XSS) vulnerability was identified in an ASP.NET web application on the ███ . The issue arises from improper handling of URLs passed to the ResolveUrl method, which fails to sanitize user-controlled input. This allows injection of arbitrary JavaScript payloads that execute in the context of the user’s browser. Some ASP.NET web applications that use the Control.ResolveUrl method to resolve app-root-relative paths are vulnerable to XSS.
Payload used: (Z('ontestingb3t2h onload=print`` fnwve='zzzzz`8504695818`'))
- This payload successfully triggered JavaScript execution using the onload attribute.
- The use of print`` instead of alert()` was necessary to bypass Web Application Firewall (WAF) protections and filter-based sanitization.
PoC: ██████████(Z('ontestingb3t2h%20onload=print%60%60%20fnwve='zzzzz%608504695818%60'))/accounts/accessDenied.aspx
References
████████
Impact
Exploitation of this vulnerability can lead to severe consequences, including but not limited: Session Hijacking: Attackers can steal cookies and impersonate legitimate users.
System Host(s)
█████████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
Open the link.
Suggested Mitigation/Remediation Actions
Apply context-dependent encoding and/or validation to user input rendered on a page.
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
Root cause
Likely the application passed user-controlled input into ASP.NET's ResolveUrl method without sanitising it, so the method returned a value containing executable markup.
Impact
An attacker could steal cookies and impersonate legitimate users, though the report notes a WAF was present and the payload was adapted to bypass it.
What the attacker needed
Victim clicks a crafted link
The fix
The application should apply context-dependent encoding and validation to user input before rendering it on a page.
How it was found
- Open the crafted link containing the injected payload in a browser.
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.
When a website builds a link using input from the address bar without cleaning it first, an attacker can slip in extra code. Here, a crafted link made the page run JavaScript in the visitor's browser, which could let the attacker steal the visitor's login session.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.