Skip to content
XSS Disclosed report Intermediate

Cross-Site Scripting (XSS) in ASP.NET via ResolveUrl on ███████

An ASP.NET application failed to sanitise user-controlled input passed to the ResolveUrl method, allowing an attacker to inject JavaScript that executes in a victim's browser. The attacker could steal session cookies and impersonate legitimate users.

jonasdiasrebelo Follow

Originally disclosed on HackerOne

  • Triaged in 3 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'))/pageNotFound.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.

The original report as published on HackerOne, by jonasdiasrebelo. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 to ASP.NET's ResolveUrl method without context-dependent encoding or validation, so the input was rendered as 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/or validation to user input rendered on a page.

How it was found

  1. Open the crafted link containing the payload in the pageNotFound.aspx path.

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.

Cross-Site Scripting (XSS) is when a website lets an attacker sneak their own JavaScript code into a page that other people view. Here, the site took a URL from the user and put it into the page without cleaning it, so the attacker's code ran in the victim's browser. That code could then read the victim's login cookie and send it to the attacker.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by jonasdiasrebelo

View all

27 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.