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.
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.
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
- Open the Attack page and enter a URL in the url field.
- Submit the form and observe that the URL is reflected in the href attribute of a link.
- Add characters to the url value to break out of the attribute or use a javascript: scheme.
- 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.