Skip to content
XSS Disclosed report Intermediate

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

An ASP.NET application using the ResolveUrl method failed to sanitise user-controlled URL input, 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'))/support.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 unsanitised user input into ASP.NET's ResolveUrl method, which then rendered it into the page without context-appropriate encoding.

Impact

An attacker could steal cookies and impersonate legitimate users, though the report notes a WAF was bypassed with a modified payload.

What the attacker needed

Victim clicks a crafted link

The fix

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 injected payload.

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 from something a user typed, it must clean that input first. Here the site did not, so an attacker could put a small script into the link; when a victim opens it, the script runs in their browser and can steal their login cookie.

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.