Skip to content
XSS Write-up Beginner

Reflected Xss Tag Attribute Href

The application reflects a user-supplied URL into the href attribute of an anchor tag without sanitisation, allowing an attacker to inject JavaScript. An attacker could execute arbitrary script in a victim's browser by crafting a malicious URL.

Erdemstar Follow

Published on systemweakness.com

Hello friends, today I will show you the steps of detecting a vulnerability that I encountered in Web Application Security Tests in my project named Saka Reflected XSS (Tag Attribute href) and exploiting this vulnerability.

Erdemstar, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application inserts the user-controlled url parameter into the href attribute of an anchor tag without any encoding or validation.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser, potentially stealing cookies or performing actions on behalf of the user.

What the attacker needed

Victim clicks a crafted link

How it was found

  1. Open the Attack page and enter a URL in the url field.
  2. Submit the form and observe that the URL is reflected in the href attribute of a link.
  3. Add characters to the url value to break out of the attribute or use a javascript: scheme.
  4. Send the crafted request and observe that JavaScript executes.

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 write-up has not been written yet. The Original tab links to the source.

Cross-site scripting (XSS) is when a website takes input from a user and puts it into a page without cleaning it, so an attacker can make the page run their own JavaScript. Here, the URL you type is placed directly into a link's address, so by adding special characters you can break out and run code.

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 Erdemstar

View all

4 more disclosed reports, best first.

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.