Skip to content
XSS Disclosed report Beginner

Stored XSS on wordpress.com

A poll answer field on Crowdsignal accepted an HTML attribute injection that was stored and later rendered inside a WordPress.com post, so script ran in the victim's browser. An attacker could execute malicious script in a victim's browser and redirect them to malicious sites.

riadalrashed Follow

Originally disclosed on HackerOne

  • Disclosed after 22 days

Summary:

Hello team, I found a Stored XSS vulnerability in WordPress.com via app.crowdsignal.com. It is similar to report #1987172.

Platform(s) Affected:

wordpress.com

1 .Go to https://app.crowdsignal.com/dashboard and create a poll. 2. Enter the following payload as an answer: "style="position:fixed;top:0;left:0;border:999em solid green;" onmouseover="alert(document.cookie)" 3. Go to "Share Your Poll" and copy the link. 4. Navigate to https://wordpress.com/posts and add a new post. 5. Include the copied link in the post. 6. Save the post. 7. Open the page and click on "View Results." 8. The XSS vulnerability will be triggered.

████

Impact

The attacker can use this issue to execute malicious script code in the victim user browser also redirect the victim user to malicious sites

The original report as published on HackerOne, by riadalrashed. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is wordpress.com, reached through the Crowdsignal application at app.crowdsignal.com. The researcher reports a stored cross-site scripting issue that fires when a poll created on Crowdsignal is embedded in a WordPress.com post. The report notes that it is similar to an earlier report, #1987172, but gives no further detail about that one.

The reproduction steps are short and entirely UI-driven:

  1. Go to https://app.crowdsignal.com/dashboard and create a poll.
  2. Enter the following payload as an answer:
Text
"style="position:fixed;top:0;left:0;border:999em solid green;" onmouseover="alert(document.cookie)"
  1. Go to "Share Your Poll" and copy the link.
  2. Navigate to https://wordpress.com/posts and add a new post.
  3. Include the copied link in the post.
  4. Save the post.
  5. Open the page and click on "View Results."
  6. The XSS vulnerability will be triggered.

The payload is an attribute-injection string. It starts by closing an existing attribute with a double quote, then defines a style attribute that pins the element to the viewport and paints a large green border, and finally adds an onmouseover handler that calls alert(document.cookie).

The report does not include the HTTP requests or responses involved, the exact HTML context where the answer is rendered, or which component (Crowdsignal or WordPress.com) failed to encode the value. It also does not state a fix, a bounty amount or a CVSS score. The platform records the issue as a medium-severity stored XSS in the Automattic program, disclosed on 26 June 2023.

Root cause

The report does not identify the root cause; the payload only works if the answer is rendered inside a double-quoted HTML attribute. The payload only works if the answer value is placed inside an HTML attribute delimited by double quotes: the leading " closes that attribute, and everything after it is parsed as new attributes on the same element.

The cross-origin path matters here. The poll is created on one application and embedded on another, so the value crosses a trust boundary between two products.

Impact

In the researcher's words, an attacker can use the issue to execute malicious script code in the victim user's browser and also redirect the victim to malicious sites. What an attacker could actually reach depends on which origin the payload executes in and what cookies and sessions that origin holds; the report does not analyse this. The report makes no claim about account takeover or about which users are affected beyond the general statement above.

How this kind of bug works

Stored XSS happens when user-controlled data is saved and later written into an HTML document without encoding appropriate to the place it lands. The browser's parser does not know which bytes were meant as data and which as markup, so any quote, angle bracket or event-handler attribute that survives into the response is interpreted as structure.

The context determines the escape needed. Inside a quoted attribute, a double quote ends the value; inside a script block, a closing tag or a quote in a string literal can break out; in a URL attribute, a javascript: scheme can execute. HTML entity encoding of &, <, >, " and ' at output time, applied according to context, is the core defence. Content Security Policy without unsafe-inline limits the damage of an injection that does get through, and frameworks that auto-escape template output remove most of this class by default. For rich content that must keep some markup, a sanitiser built on an allowlist of tags and attributes is the usual answer.

How to test for it

  1. Map every place where input is stored and later displayed: profile fields, comments, poll answers, form labels, filenames, support tickets, and anything that is rendered in an admin panel or an embed.
  2. For each field, submit a unique benign marker first (for example a distinctive string) and find every page and API response where it appears, including emails, exports and third-party embeds.
  3. Identify the rendering context by inspecting the HTML around the marker: attribute value, text node, script block, URL, CSS.
  4. Send a context-appropriate probe. For an attribute context, a leading double quote followed by a harmless attribute such as style is enough to see whether the parser accepts new attributes; for a text node, an angle bracket probe; for a URL, a scheme probe. Keep probes non-destructive and avoid alert where a program's rules forbid it.
  5. Confirm execution in a real browser, not just by grepping the response, and note which origin the script runs in and what that origin's cookies and permissions are.

A positive result is a probe that changes the DOM structure or runs script when the stored value is rendered to a different user or session. Common false positives: the value is reflected but HTML-encoded, so it looks present in source yet is inert; the payload only executes in your own browser because of a client-side preview; the field is only visible to the author who entered it, which removes the cross-user impact; or a sanitizer strips the handler but leaves the attribute, which is not exploitable.

How it is fixed

Apply context-aware output encoding at every point where the stored value is rendered, including embed and widget renderers that may live in a different codebase from the input form. Validate and normalise input on the way in as a secondary layer. Where markup must be preserved, run it through an allowlist sanitiser. Add a restrictive Content Security Policy and set session cookies HttpOnly so that a successful injection cannot read them. Regression tests should store a quote-and-handler payload and assert that it comes back encoded.

Hunting notes

Stored XSS tends to hide where data crosses a boundary: between two products in the same suite, between a user-facing form and an admin dashboard, between a creation UI and an embed or share widget. Polls, surveys, forms, feedback widgets and link previews are common carriers because their output is designed to be embedded elsewhere. Recon signals worth watching are share and embed endpoints, oEmbed handlers, and any feature that copies a link from one product into another.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

This report describes a stored cross-site scripting (XSS) bug on wordpress.com, reached through a separate Automattic product called Crowdsignal, which lives at app.crowdsignal.com. Crowdsignal lets you build polls and surveys; WordPress.com lets you write blog posts. The researcher found that a poll answer could carry hidden instructions that a browser would later run as code when the poll's link was added to a WordPress.com post.

To understand the idea, imagine a form where you write your name, and the website later prints it on a label. If you write Alice, the label says Alice. But if the website blindly copies whatever you typed into the label, and you type something that looks like a printing instruction rather than a name, the label machine may follow the instruction instead of printing the text. That is XSS: your data is treated as part of the page's structure rather than as harmless text.

"Stored" means the bad value is saved on the server first and then shown to everyone who views the page later, not just to the person who typed it. "Cross-site" here refers to the fact that the value is entered in one product (Crowdsignal) and displayed in another (WordPress.com).

The researcher notes the issue is similar to an earlier report, #1987172, but gives no detail about that one.

The reproduction steps are all done through the normal web interface:

  1. Go to https://app.crowdsignal.com/dashboard and create a poll.
  2. Enter the following payload as an answer:
Text
"style="position:fixed;top:0;left:0;border:999em solid green;" onmouseover="alert(document.cookie)"
  1. Go to "Share Your Poll" and copy the link.
  2. Navigate to https://wordpress.com/posts and add a new post.
  3. Include the copied link in the post.
  4. Save the post.
  5. Open the page and click on "View Results."
  6. The XSS vulnerability will be triggered.

Why each step matters:

  • Step 1 creates the object that will hold the malicious value. A poll answer is a piece of text the site stores and later displays.
  • Step 2 is the payload itself. It is not a normal answer; it is written to look like part of the page's HTML markup. The leading " is meant to close whatever attribute the site wraps around the answer. Finally onmouseover="alert(document.cookie)" attaches an event handler: when the mouse moves over the element, the browser runs alert(document.cookie), which pops up a box showing the site's cookies.
  • Step 3 copies the share link, which is how the poll gets carried into another product.
  • Steps 4 to 6 put that link inside a WordPress.com post and save it.
  • Steps 7 and 8 open the page and interact with it, which is when the stored value is rendered and the handler fires.

A cookie is a small piece of data a website asks your browser to keep and send back on later requests; it is often used to remember that you are logged in. A session cookie is effectively a temporary key to your account, so being able to read it in script is serious. The proof of concept only shows the cookie in an alert box; the report does not analyse what an attacker could do with it in practice.

The report does not include the HTTP requests or responses involved, the exact HTML around the answer, or which of the two products failed to encode the value. It also does not state a fix, a bounty amount or a CVSS score. The platform records it as a medium-severity stored XSS in the Automattic program, disclosed on 26 June 2023.

In general, how this kind of bug works

A web page is text that a browser reads and turns into structure: headings, links, buttons, and attributes such as style or onmouseover that tell the browser how an element looks or behaves. When a site takes text from a user and pastes it into that page without checking it, the browser cannot tell which characters were meant as data and which as structure. A quote character that was meant to be part of an answer can end an attribute early, and anything after it is read as new markup.

The defence is called output encoding: when the site writes stored text into a page, it converts characters such as &, <, >, " and ' into safe representations so the browser shows them as text instead of acting on them. The right encoding depends on where the value lands: inside a quoted attribute, inside a script block, or inside a URL each needs different handling. A Content Security Policy is an extra instruction from the server telling the browser which scripts are allowed to run, which limits the damage if something slips through. For content that must keep some formatting, a sanitiser that allows only a known list of tags and attributes is the usual approach.

To look for this kind of bug, a tester maps every place where input is saved and later shown: profile fields, comments, poll answers, form labels, filenames, support tickets, admin panels and embeds. For each one, they submit a unique harmless marker and find every page or response where it appears. Then they inspect the surrounding HTML to see the context, and send a small probe suited to that context, for example a leading double quote followed by a harmless attribute to see whether the browser accepts new attributes. Confirmation should happen in a real browser, and the tester should note which site's origin the script runs in and what that origin can access. Common false positives include values that look present in the page source but are encoded and inert, payloads that only run in your own preview, fields visible only to their author, and sanitisers that strip the handler but leave the attribute.

Fixes follow the same logic: encode output in every place the stored value is rendered, including embed and widget code that may live in a different codebase from the input form; validate input as a secondary layer; sanitise rich content with an allowlist; add a restrictive Content Security Policy; and mark session cookies HttpOnly so script cannot read them. Regression tests should store a quote-and-handler payload and check that it comes back encoded.

Stored XSS tends to hide where data crosses a boundary: between two products in the same suite, between a user form and an admin dashboard, or between a creation tool and a share or embed widget. Polls, surveys, forms and link previews are common carriers because their output is designed to be embedded elsewhere.

Glossary

  • Stored XSS: XSS where the malicious value is saved on the server and shown to later visitors, not just reflected back once.
  • Payload: the specific piece of text an attacker submits to trigger a bug.
  • Attribute: a setting written inside an HTML tag, such as style or onmouseover, that changes how an element looks or behaves.
  • Attribute injection: breaking out of an existing attribute with a quote so that new attributes are read as part of the page.
  • Event handler: code attached to an element that runs when something happens, such as a mouse moving over it.
  • onmouseover: the event that fires when the pointer moves onto an element.
  • alert(): a browser function that shows a pop-up box; often used in proofs of concept to show that script ran.
  • Cookie: a small value a site asks the browser to store and send back on later requests, often used to keep you logged in.
  • Session cookie: a cookie that acts as a temporary key to your logged-in session.
  • document.cookie: the browser property that exposes the cookies readable by the current page's script.
  • Origin: the combination of scheme, host and port that a page belongs to; script running in one origin is normally kept apart from another.
  • Embed: placing content from one site inside a page on another site, often by pasting a link.
  • Output encoding: converting characters in stored text so the browser displays them as text rather than acting on them.
  • Sanitiser: a tool that removes unsafe markup from content while keeping an allowed set of tags and attributes.
  • Content Security Policy (CSP): a server instruction telling the browser which scripts may run on a page.
  • HttpOnly: a cookie setting that stops page script from reading that cookie.
  • CVSS: a standard scoring system for rating the severity of a vulnerability.
  • False positive: a result that looks like a bug but is not actually exploitable.

More by riadalrashed

View all

4 more disclosed reports, best first.

More from Automattic

View all

The newest disclosed reports for this program.

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.