Skip to content
XSS Disclosed report Intermediate

[public-api.wordpress.com] Stored XSS via Crafted Developer App Description

ysx Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 46 hours
  • Paid in 46 hours
  • Disclosed after 46 hours

Summary by the researcher

A crafted third-party app description could be leveraged to execute arbitrary JavaScript on the WordPress.com Public API endpoint through an OAuth authorize link. Thanks again to @xknown for the highly impressive response and remediation time.

The report

Hi,

An injection in the "App Description" field within the WordPress Developers platform can be used to store and reflect JavaScript in the public-api.wordpress.com context.

Steps to reproduce

  1. As the "adversary" user, please visit the WordPress.com My Apps page and select "Create New Application"

  2. Populate the "Name" and "Website URL" fields with generic data, and set the Redirect URL to https://google.com for the purposes of this demonstration

  3. Next, please copy the below proof of concept payload into the "Description" field, save your App, and take note of the client ID

  4. Substitute the client ID into the following URL (which can be accessed by any user to reproduce this vulnerability)

https://public-api.wordpress.com/oauth2/authorize?client_id=YourID&redirect_uri=https://google.com&response_type=code&blog=
  1. Finally, mouse over the TESTLINK text to execute the JavaScript payload.

Proof of concept payload

'"><div id="test"><head><base href="javascript://"/></head><body><a href="/. /, /' onmouseover=confirm(document.domain); abc=abc">TESTLINK

Supporting evidence

WP_API_XSS.png
WP_API_XSS.png From the original on HackerOne

Verified conditions

At the time of testing, I have successfully confirmed exploitability in the following environments:

  • Chrome OS 63.0.3239.50 (Official Build) beta (64-bit)
  • Firefox 55.0.3 stable (32-bit) on Ubuntu 16.04.3 LTS

Thanks,

Yasin

Impact

An adversary can leverage this vulnerability in a crafted API authorisation request that, if issued by another WordPress.com user, will cause arbitrary JavaScript code to execute within the target's browser in the context of their WordPress session.

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A medium-severity XSS bug in Automattic. HackerOne made it public on 1 December 2017.

About XSS

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by ysx

View all

25 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.