XSS Stored
A stored cross-site scripting flaw existed in the first name field of a user profile, allowing an attacker to inject a script that executed when the profile was viewed. An attacker could create an account with a malicious first name and trigger a popup when a victim visited the affected page.
Originally disclosed on HackerOne
- Triaged in 3 days
- Fixed in 10 days
- Disclosed after 11 months
Hi ███,
This is ███, An Ethical Hacker.
I Have Found Stored XSS In Your Site :)
█████████
Now I Am Going To Show You.
1.Create An Account In Your Site. ███████ 2.And Put This Script in First Name. "><img src=x onerror=prompt(1337)> 3.Save it :) 4.Account Created now Go to this Web ██████████ 5.Click On Login. 6.Checkout the Popup ;) XSS Stored popup :)
Checkout Also My POC I Have Explained :)
█████
Please Resolve this Issue,This is Very Critical.
Best Regards, ███ █████████
What the report shows
The researcher reports a stored cross-site scripting (XSS) issue. The report is short and informal: it states that a stored XSS was found, then walks through a reproduction in six steps.
The steps, as written:
- Create an account on the site.
- Put the following script in the First Name field:
"><img src=x onerror=prompt(1337)>
- Save it.
- With the account created, go to the web page named in the report (the URL is redacted in the disclosed text).
- Click on Login.
- Observe the popup: the researcher describes it as a stored XSS popup.
The report also refers to a proof-of-concept explanation, but the link or content is redacted, so the only artefact available is the payload above and the six steps. No HTTP request, response, header or parameter name is given beyond the First Name field. The report does not state a bounty amount, a CVSS score, the affected asset, or how the issue was fixed.
The payload is a classic breakout: a double quote closes an existing attribute value, then an img element with a broken src triggers onerror, which calls prompt(1337). The use of prompt is a harmless marker; it demonstrates script execution without doing anything destructive.
Root cause
The report implies that the value submitted as First Name is stored and later rendered into a page without adequate output encoding, so the injected markup is interpreted by the browser rather than displayed as text. The exact rendering context is not described: the payload begins with a double quote, which suggests the value is placed inside an HTML attribute, but the report does not show the surrounding markup. Treat that as likely rather than confirmed.
That is what makes it stored XSS rather than reflected.
Impact
The report shows the script executing as a popup when the page is loaded, but does not show it running for another user. In the report's own demonstration the effect is a prompt dialog, which proves execution but not harm. The report calls the issue "very critical" but gives no exploitation beyond the popup, so the practical impact on this target is not established in the text.
How this kind of bug works
Stored XSS happens when user-supplied data is persisted (in a database, profile record, comment, ticket, and so on) and later written into an HTML page without context-appropriate encoding. The browser cannot tell attacker data from legitimate markup, so any tags or event handlers in the value are parsed and executed.
The context matters. A value placed between tags needs <, > and & encoded; a value placed inside an attribute needs the quote character that delimits the attribute encoded as well; a value inside a script block or a URL needs different treatment again. The payload in this report starts with ", which is the signature of an attribute-context breakout.
Defences are layered: output encoding at the point of rendering (not input filtering at the point of storage), a strict Content Security Policy that blocks inline handlers, and framework templating that escapes by default. Input validation can reduce the attack surface but is not a substitute for correct output encoding, because the same stored value may be rendered in several different contexts.
How to test for it
- Identify every field whose value is stored and later displayed: profile names, addresses, comments, support tickets, team names, file names, and so on.
- Submit a unique, harmless marker such as a short alphanumeric string first, and find every page and view where it appears. This maps the rendering contexts before you try any payload.
- For each context, submit a payload that matches it. In an attribute context, try breaking out of the quotes with a quote character followed by an element with an event handler. Between tags, try a simple element with an event handler. In a URL context, try a
javascript:scheme. - Reload the page, and also view it as another user or in another role if the application allows it, since stored XSS often fires for a different viewer than the submitter.
- A positive result is your marker appearing as live markup and your handler executing (a dialog, a console message, or a network request to a host you control).
Common false positives: the payload appearing HTML-encoded in the page source (correct behaviour), execution only in your own browser due to a client-side preview, payloads that only work because of a browser extension, and self-XSS where the value is only ever rendered back to the same user with no privilege boundary crossed. Also check whether a CSP or a sanitizer strips the handler but leaves the tag, which is not exploitable on its own.
How it is fixed
The standard fix is context-aware output encoding at every point where stored data is rendered, using the templating engine's escaping rather than hand-built strings. Where rich text is genuinely required, run it through a well-maintained HTML sanitizer with an allowlist of tags and attributes, and strip event handlers and dangerous URL schemes. Add a Content Security Policy that disallows inline script and inline event handlers as defence in depth. Validate and normalise input on the server as a secondary control, and review every view that renders the affected field, not just the one where the bug was found.
Hunting notes
Stored XSS tends to hide in fields that are entered once and displayed in many places: display names, job titles, company names, addresses, and anything shown in admin panels, emails, PDF exports or support dashboards. The second rendering context is often less protected than the first, so map all of them.
Recon signals include profile and settings pages that accept free text, features that generate notifications or activity feeds, and any place where one user's data is shown to another (support staff, moderators, teammates). Applications with separate admin interfaces are worth attention because the stored value may reach a higher-privileged viewer.
To make a report accepted, show the full path from storage to execution: the request that saves the value, the page that renders it, and the identity of the viewer who triggers it. Use a harmless marker such as a dialog or a request to your own listener, and state clearly which user or role is affected. If the value only renders for the submitting user, say so, because that changes the severity.
What happened, in plain words
A security researcher reported a stored cross-site scripting (XSS) bug. It is short and informal: it says a stored XSS was found, then walks through a reproduction in six steps.
Before the steps, a little background helps. A web page is built from HTML, a language of tags such as <img> for an image. Tags can carry attributes, which are settings written inside the tag, and some attributes can run small pieces of JavaScript, the programming language browsers execute. A profile page that shows your name is a typical place where text you typed is placed back into a page. If the site does not treat that text carefully, the browser may read it as code instead of as plain text.
"Stored" means the value is saved on the server, the computer that runs the site, and shown again later to whoever views the page. That is different from a value that only bounces straight back to the person who typed it.
The steps, as written:
- Create an account on the site.
- Put the following script in the First Name field:
"><img src=x onerror=prompt(1337)>
- Save it.
- With the account created, go to the web page named in the report (the URL is redacted in the disclosed text).
- Click on Login.
- Observe the popup: the researcher describes it as a stored XSS popup.
The report also refers to a proof-of-concept explanation, but the link or content is redacted, so the only artefact available is the payload above and the six steps. No HTTP request, response, header or parameter name is given beyond the First Name field. The report does not state a bounty amount, a CVSS score, the affected asset, or how the issue was fixed.
The payload, piece by piece
"><img src=x onerror=prompt(1337)>
"is a double quote. It is there to close a quote that the page already opened around the name. Imagine a form line that readsvalue="and then your name; the quote you type ends that value early.<imgstarts an image tag. The browser now expects an image.src=xtells the browser the image is at the addressx. No such image exists, so loading it fails.onerror=prompt(1337)is an event handler: a piece of JavaScript the browser runs when something goes wrong, here when the image fails to load.prompt(1337)opens a small dialog box showing the number 1337.>closes the tag.
The dialog is a harmless marker. It proves that the browser ran the researcher's JavaScript, without doing anything destructive. That is why the report says "Checkout the Popup".
In general, how this kind of bug works
Stored XSS happens when data a user supplies is saved (in a database, a profile record, a comment, a support ticket) and later written into an HTML page without being encoded for the place where it lands. Encoding means converting characters that have special meaning in HTML into safe stand-ins, so the browser shows them as text rather than acting on them. The browser cannot tell attacker data from legitimate markup, so any tags or event handlers in the value are parsed and run.
The context matters. A value placed between tags needs <, > and & encoded. A value placed inside an attribute also needs the quote character that delimits the attribute encoded. A value inside a script block or a URL needs different treatment again. The payload here starts with ", which is the signature of an attribute-context breakout: the quote ends the attribute early and lets a new tag begin.
The report does not describe who views the page where the value is rendered. That is what makes it stored rather than reflected.
Impact
The report shows the script running as a popup when the page is loaded, but does not show it running for another user. In the demonstration the effect is only a prompt dialog, which proves execution but not harm. The report calls the issue "very critical" but gives no exploitation beyond the popup, so the practical impact on this target is not established in the text.
How to test for it
- Identify every field whose value is stored and later displayed: profile names, addresses, comments, support tickets, team names, file names, and so on.
- Submit a unique, harmless marker such as a short alphanumeric string first, and find every page and view where it appears. This maps the rendering contexts before you try any payload.
- For each context, submit a payload that matches it. In an attribute context, try breaking out of the quotes with a quote character followed by an element with an event handler. Between tags, try a simple element with an event handler. In a URL context, try a
javascript:scheme. - Reload the page, and also view it as another user or in another role if the application allows it, since stored XSS often fires for a different viewer than the submitter.
- A positive result is your marker appearing as live markup and your handler running (a dialog, a console message, or a network request to a host you control).
Common false positives: the payload appearing HTML-encoded in the page source (correct behaviour), execution only in your own browser due to a client-side preview, payloads that only work because of a browser extension, and self-XSS where the value is only ever rendered back to the same user with no privilege boundary crossed. Also check whether a Content Security Policy or a sanitizer strips the handler but leaves the tag, which is not exploitable on its own.
How it is fixed
The standard fix is context-aware output encoding at every point where stored data is rendered, using the templating engine's escaping rather than hand-built strings. Where rich text is genuinely required, run it through a well-maintained HTML sanitizer with an allowlist of tags and attributes, and strip event handlers and dangerous URL schemes. Add a Content Security Policy that disallows inline script and inline event handlers as defence in depth. Validate and normalise input on the server as a secondary control, and review every view that renders the affected field, not just the one where the bug was found.
Hunting notes
Stored XSS tends to hide in fields that are entered once and displayed in many places: display names, job titles, company names, addresses, and anything shown in admin panels, emails, PDF exports or support dashboards. The second rendering context is often less protected than the first, so map all of them.
Recon signals include profile and settings pages that accept free text, features that generate notifications or activity feeds, and any place where one user's data is shown to another (support staff, moderators, teammates). Applications with separate admin interfaces are worth attention because the stored value may reach a higher-privileged viewer.
To make a report accepted, show the full path from storage to execution: the request that saves the value, the page that renders it, and the identity of the viewer who triggers it. Use a harmless marker such as a dialog or a request to your own listener, and state clearly which user or role is affected. If the value only renders for the submitting user, say so, because that changes the severity.
Glossary
- XSS (cross-site scripting): a bug where a site lets an attacker's JavaScript run in another user's browser.
- Stored XSS: XSS where the malicious value is saved on the server and shown later to viewers of a page.
- Reflected XSS: XSS where the value bounces straight back in the same response, without being saved.
- Self-XSS: XSS that only affects the person who entered the value, with no other user or privilege crossed.
- Payload: the piece of text or code an attacker submits to trigger a bug.
- HTML: the language of tags that describes the structure of a web page.
- Tag: an HTML element such as
<img>, written between angle brackets. - Attribute: a setting inside a tag, such as
srcoronerror. - Event handler: an attribute whose value is JavaScript that runs when an event occurs, such as an image failing to load.
- JavaScript: the programming language browsers execute.
prompt(): a browser function that opens a dialog box with a message.- Encoding (output encoding): converting special characters into safe stand-ins so the browser displays them as text.
- Context: the place in the HTML where a value lands (between tags, inside an attribute, inside a script or URL), which decides what encoding is needed.
- Sanitizer: a tool that removes dangerous tags and attributes from user-supplied HTML.
- Content Security Policy (CSP): a set of rules a site sends to the browser that restricts what scripts may run.
- Server: the computer that runs a website and stores its data.
- Database: organised storage on the server where saved values live.
- False positive: a test result that looks like a bug but is not exploitable.
- CVSS: a standard scoring system for the severity of a vulnerability.