Self stored Xss + Login Csrf
The username field allowed a stored cross-site scripting payload when the client-side length limit was bypassed, and a login CSRF flaw let an attacker force a victim into the attacker's account so the payload would execute. An attacker could run JavaScript in a victim's browser.
- Disclosed after 5 months
Description:
User can set username between 8-20 alphanumeric characters, but with the help of inspect element attacker can manipulate ██████= & can insert a xss payload resulting in self stored xss & with the help of login csrf attacker can force the victim into attacker's account causing successful execution of javascript.
█████████
Payload used = "><img src onerror=confirm(document.cookie)>
Impact
Able to execute javascript in victim's browser
System Host(s)
█████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
- Visit Sign in and sign in
- Click on Change username --> Open inspect element --> change max length of new username and confirm username to
100 - Now enter the payload in
new usernameandconfirm usernamefield & click on submit --> Sign out - Enter the credentials to sign in --> Intercept request using burp --> Action --> Engagement Tools --> Generate Csrf poc --> Copy html.
- Open notepad & paste --> save as .html file
- Open the html file in any browser to confirm the vulnerability.
Poc attached :-
███████
Suggested Mitigation/Remediation Actions
Sanitization of input must be done
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 username was not sanitised or length-checked on the server, and the login form lacked CSRF protection.
Impact
An attacker could execute JavaScript in a victim's browser, but only after forcing the victim into the attacker's account via login CSRF.
What the attacker needed
Attacker can create an account; victim opens a crafted HTML file; victim is logged into attacker's account
How it was found
- Sign in to the site.
- Open the change-username page, use the browser inspector to raise the maximum length, and set both username fields to a long value.
- Enter the XSS payload in both username fields and submit, then sign out.
- Sign in again while intercepting the request, and use the proxy tool to generate a CSRF proof-of-concept HTML page.
- Save the generated HTML as a file and open it in a browser to confirm the vulnerability.
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.
A site let users pick a username but only checked its length in the browser, so an attacker could edit the page to send a longer name containing code. Separately, login CSRF let an attacker log a victim into the attacker's own account, where the malicious username ran as JavaScript.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.