Skip to content
XSS Disclosed report Beginner

Stored XSS from ticket messages in admin table in SupportFlow

SupportFlow does not escape ticket content when rendering the admin ticket list, so a stored XSS payload in a ticket executes in an administrator's browser.

whitehatter Follow

Originally disclosed on HackerOne

Bounty$50 View original
  • Triaged in 13 hours
  • Fixed in 13 days
  • Paid in 39 hours
  • Disclosed after 13 days

SupportFlow containers a stored XSS vulnerability in how it generates the admin table of tickets at SupportFlow -> All Tickets (/wp-admin/edit.php?post_type=sf_ticket).

Any ticket can be created with an XSS payload like this:

<script>alert('XSS');</script>

When an admin goes to view the table of tickets, XSS is triggered, because the value is never escaped here:

https://github.com/SupportFlow/supportflow/blob/71a6053848c523f7b50b61a1f3770013badc76c0/classes/class-supportflow-admin.php#L1175

I've attached a screenshot demonstrating the XSS payload - please let me know if there are any questions.

Attachments

Screen_Shot_2016-06-15_at_11.07.55_PM.png
Screen_Shot_2016-06-15_at_11.07.55_PM.png From the original on HackerOne

The original report as published on HackerOne, by whitehatter. 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. 4 min read.

What the report shows

The target is SupportFlow, and the vulnerable feature is the admin ticket table. The vulnerable feature is the admin ticket table reached through SupportFlow -> All Tickets at /wp-admin/edit.php?post_type=sf_ticket.

The researcher found that the value is never escaped when the plugin builds that table. Any ticket can be created with a payload such as:

HTML
<script>alert('XSS');</script>

When an administrator opens the ticket table, the stored value is rendered into the page and the script executes. The report points to the exact line responsible, in the admin class of the plugin:

Text
https://github.com/SupportFlow/supportflow/blob/[redacted]/classes/class-supportflow-admin.php#L1175

The researcher attached a screenshot showing the payload firing.

Screen_Shot_2016-06-15_at_11.07.55_PM.png
Screen_Shot_2016-06-15_at_11.07.55_PM.png From the original on HackerOne

It does not give a severity rating, a CVSS score or a fix.

Root cause

The likely cause is that the value taken from a ticket is written into the admin table's HTML without output encoding. The report states plainly that the value is never escaped at the referenced line. Stored data that reaches an HTML context unencoded is interpreted by the browser as markup, so a script tag saved in a ticket becomes executable script when the table is rendered.

Impact

The payload runs in the session of an administrator viewing the ticket list. That places an attacker's script inside the admin area of the site, where it can act with the administrator's privileges. The report demonstrates execution with an alert and does not describe any further exploitation, so the practical reach beyond script execution in the admin session is not shown.

How this kind of bug works

Stored cross-site scripting arises when input that is saved by the application is later placed into a page without context-appropriate encoding. The database is not the problem; the sink is. A value that is harmless as text becomes dangerous the moment it is concatenated into an HTML document, because the browser parses it as markup and runs any script it contains.

Admin-side sinks are especially valuable to an attacker. The stored value is rendered on a page only privileged users visit. The script therefore executes with the administrator's cookies and capabilities, and can perform actions the attacker could not perform directly.

The defences are output encoding at the point of rendering, matched to the context (HTML body, attribute, URL, JavaScript), and input validation where a field has a known shape. A Content Security Policy that forbids inline script reduces the damage but does not remove the underlying flaw. Framework helpers that escape by default, used consistently, prevent most of these bugs.

How to test for it

  1. Map every place where user-supplied data is saved and later displayed, paying particular attention to administrative list tables, dashboards and detail views that aggregate records created by other users.
  2. Submit a distinctive marker through each input, for example a short alphanumeric string, and find where it appears in the interface.
  3. Inspect the rendered HTML around the marker to see whether it was encoded. If the marker appears inside an attribute, a script block or a URL, note the context.
  4. Send a benign proof payload appropriate to that context and reload the page as a privileged user. A positive result is the payload executing in the admin's browser, not merely appearing in the page source.
  5. Confirm the data survives a round trip through storage, so that the finding is genuinely stored rather than reflected.

Common false positives include payloads that appear in the response but are HTML-encoded, values that are only reflected back to the same user who submitted them, and cases where a filter strips the dangerous characters before storage. Check the raw response body rather than the rendered page, and test with a second account to prove the stored nature of the issue.

How it is fixed

Escape all stored values at output time with the encoding appropriate to the context. In WordPress, functions such as esc_html, esc_attr and esc_url are the standard tools, applied at the sink rather than on save. Where a field has a restricted format, validate it on input as well. Review every column and cell in administrative tables that display user-controlled content, since a single unescaped cell is enough.

Hunting notes

This class of bug hides wherever one user's input is shown to another, especially in admin interfaces: ticket and support systems, comment moderation queues, order notes, contact form submissions, user profile fields and log viewers. Custom post types and plugin-generated list tables are frequent offenders because they often build HTML by hand instead of using the platform's escaping helpers.

Recon signals include plugins that register custom post types with public submission forms, admin pages that list records created by unprivileged users, and code that concatenates database values into table markup. Reading the plugin source for output functions is often faster than blind testing.

A screenshot or short recording of the alert firing in the admin view is usually enough to establish impact.

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. 6 min read.

What happened, in plain words

SupportFlow is software that lets a site run a support desk: tickets are created and staff read them. The report is about one screen in that plugin, the list of all tickets that an administrator sees under SupportFlow -> All Tickets, at the address /wp-admin/edit.php?post_type=sf_ticket.

A ticket is just a message a user types into a form. The researcher found that the plugin prints the ticket value into that admin list without escaping it. That is the whole bug: text a normal user controls ends up being treated as part of the web page itself.

To show it, the researcher created a ticket containing this:

HTML
<script>alert('XSS');</script>

Line by line: <script> is the HTML tag that tells a browser "everything until </script> is computer code, run it". alert('XSS') is a tiny piece of JavaScript, the language browsers run, that opens a pop-up box showing the text XSS. </script> closes the tag. On its own this is harmless: it only makes a pop-up appear. Its purpose here is proof. If the box appears, the browser ran the researcher's code.

When an administrator opens the ticket table, the saved text is placed into the page as if it were part of the page's own design, so the browser runs the script. The researcher pointed to the exact line of the plugin's code responsible, in the admin class of the plugin:

Text
https://github.com/SupportFlow/supportflow/blob/[redacted]/classes/class-supportflow-admin.php#L1175

and attached a screenshot showing the pop-up firing in the admin view:

Screen_Shot_2016-06-15_at_11.07.55_PM.png
Screen_Shot_2016-06-15_at_11.07.55_PM.png From the original on HackerOne

It gives no severity rating, no CVSS score and no fix.

Why this matters

A browser cannot tell the difference between a script the site's developers wrote and a script that arrived inside a ticket. Both are just text in the page, so both run. That means the researcher's code runs inside the administrator's logged-in session, the period during which the site recognises the admin as logged in. In that position a script runs with the admin's rights, though the report only demonstrates the pop-up. The report only demonstrates the pop-up and does not describe any further use, so how far an attacker could take it is not shown.

The root cause

The report says plainly that the value is never escaped at the referenced line. Escaping means converting characters that have a special meaning in HTML into plain text, so that < becomes something the browser displays as a character rather than reads as the start of a tag. The database is not the problem: storing the text is fine. The problem is the moment the text is copied into the page without that conversion.

In general, how this kind of bug works

This is called stored cross-site scripting, often shortened to stored XSS. "Cross-site" because one person's input ends up running as code in another person's browser; "stored" because the dangerous text is saved first and fires later, every time the page is opened.

A useful comparison is a noticeboard. If someone pins a note that says "ignore all notices", readers treat it as a note. But if the board's rules say any note is reprinted word for word onto official letterhead, that note now looks official. Escaping is the rule that says: reprint the words, never the formatting.

Admin-side pages are especially attractive targets. The text is displayed on a page only privileged staff visit. The script therefore runs with the administrator's rights, and can do things the person who typed the ticket could never do directly.

The defences are:

  1. Output encoding at the point of rendering, matched to where the value lands (page body, an attribute, a link, a script block).
  2. Input validation where a field has a known shape, such as a number or a date.
  3. A Content Security Policy, a header that tells the browser which scripts are allowed, which limits the damage from inline script but does not remove the flaw.
  4. Framework helpers that escape by default, used consistently.

How to test for it

  1. Map every place where user-supplied data is saved and later displayed, paying particular attention to admin list tables, dashboards and detail views that gather records created by other users.
  2. Submit a distinctive marker through each input, for example a short alphanumeric string, and find where it appears in the interface.
  3. Inspect the rendered HTML around the marker to see whether it was encoded. If the marker appears inside an attribute, a script block or a link, note the context.
  4. Send a benign proof payload appropriate to that context and reload the page as a privileged user. A positive result is the payload executing in the admin's browser, not merely appearing in the page source.
  5. Confirm the data survives a round trip through storage, so the finding is genuinely stored rather than reflected.

Common false positives include payloads that appear in the response but are HTML-encoded, values that are only shown back to the same user who submitted them, and cases where a filter strips the dangerous characters before storage. Check the raw response body rather than the rendered page, and test with a second account to prove the stored nature of the issue.

How it is fixed

Escape all stored values at output time with the encoding appropriate to the context. In WordPress, functions such as esc_html, esc_attr and esc_url are the standard tools, applied where the value is printed rather than when it is saved. Where a field has a restricted format, validate it on input as well. Review every column and cell in admin tables that display user-controlled content, since a single unescaped cell is enough.

Hunting notes

This class of bug hides wherever one user's input is shown to another, especially in admin interfaces: ticket and support systems, comment moderation queues, order notes, contact form submissions, user profile fields and log viewers. Custom post types and plugin-generated list tables are frequent offenders because they often build HTML by hand instead of using the platform's escaping helpers.

Recon signals include plugins that register custom post types with public submission forms, admin pages that list records created by unprivileged users, and code that joins database values into table markup. Reading the plugin source for output functions is often faster than blind testing.

A screenshot or short recording of the pop-up firing in the admin view is usually enough to establish impact.

Glossary

  • WordPress: a popular system for building websites, extended by add-ons called plugins.
  • Plugin: add-on software that adds features to a WordPress site.
  • Support ticket: a message a user submits to ask for help, tracked by a support system.
  • Custom post type: a WordPress way of storing a new kind of record, such as a ticket, alongside ordinary blog posts.
  • Administrator: a user account with full control over a site.
  • Session: the period during which a site recognises a user as logged in.
  • HTML: the language that describes the structure of a web page.
  • Tag: a piece of HTML such as <script> that marks up the page.
  • JavaScript: the programming language browsers run inside web pages.
  • XSS (cross-site scripting): a bug where someone's input is treated as code in another person's browser.
  • Stored XSS: XSS where the dangerous text is saved and fires each time the page is viewed.
  • Payload: the small piece of code used to prove a bug exists.
  • Escaping / output encoding: converting special characters into plain text so a browser displays them instead of acting on them.
  • Sink: the place in code where data is written into a page.
  • Input validation: checking that submitted data has the expected shape before accepting it.
  • Content Security Policy: a header that tells the browser which scripts a page may run.
  • Bounty: a reward paid for a valid security report.
  • CVSS: a standard scoring system for the severity of a vulnerability.
  • False positive: a finding that looks like a bug but is not one.

More by whitehatter

View all

3 more disclosed reports, best first.

More from Ian Dunn

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.