Skip to content
XSS Disclosed report Beginner

XSS on www.mapbox.com/authorize

stefanovettorazzi Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 4 months
  • Paid in 4 months
  • Disclosed after 14 months

Description

When you don't include the parameter client_id in the request to the endpoint at https://www.mapbox.com/authorize/, the template template-modal-unauthorized (included in the client code of the endpoint) is rendered with the value of the parameter redirect_uri sent in the request without escaping:

HTML
Code at https://www.mapbox.com/authorize/
<% if (obj.redirect) { %>
      <div class='fill-gray pad2y pad4x center'>
        <a href='<%= obj.redirect %>' class='button col12 close'>Back</a>
      </div>
<% } %>
JavaScript
Code at https://www.mapbox.com/authorize/authorize.js
}).fail(function(err) {
        Views.modal.show('unauthorized', {
            msg: err.statusText,
            redirect: (App.param('redirect_uri')) ?
                App.param('redirect_uri') :
                false
        });
});

The problem is that you can pass any value to redirect_uri and it is going to be added as HTML code, which allows to break the <a> element using a ' and a >.

Reproduction

Load the following URL on Chrome, Firefox, Safari, Internet Explorer 11, or Edge.

https://www.mapbox.com/authorize/?redirect_uri=%27%3E%3Csvg%20onload=%27alert%28document.domain%29%27%3E

I'm going to share a link to the video in a comment, because the size is greater than 10MB.


Let me know if you need more information.

The original report as published on HackerOne, by stefanovettorazzi. 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 XSS bug in Mapbox. HackerOne made it public on 14 August 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 stefanovettorazzi

View all

17 more disclosed reports, best first.

More from Mapbox

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.