Skip to content
XSS Disclosed report Beginner

stored xss in comments : driver exam

A stored cross-site scripting flaw existed in a third-party web application used by Grab. An attacker could inject script that would run for other users of that application.

paresh_parmar Follow

Originally disclosed on HackerOne

Bounty$250 Medium View original
  • Triaged in 6 days
  • Fixed in 47 days
  • Paid in 22 days
  • Disclosed after 56 days

Summary by the program

@paresh_parmar found a Stored XSS vulnerability in an out-of-scope third party web application use by Grab. We decided to make an exception of our bug bounty policy here and accepted this out-of-scope finding because we believed that the stored-XSS was a real risk for our customers.

With the researcher's help the third party vendor were able to resolve this vulnerability. We shared the researcher personal information to them in order to be transparent and in case they would like to thanks him directly.

We would like to thanks Paresh for his great work. We look forward to see more of his reports in the future.

The original report as published on HackerOne, by paresh_parmar. 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 finding is a stored cross-site scripting (XSS) vulnerability, titled as being in comments of a driver exam application. The application is a third party product used by Grab, and it sits outside the scope defined by the bug bounty programme. The researcher, paresh_parmar, reported it anyway, and the programme accepted it as an exception to its policy because it judged the stored XSS to be a real risk for its customers.

The report itself is short and does not include the request, the payload, the affected endpoint or the response. What it does record is the sequence of events:

  1. The researcher identified a stored XSS in the comments of the driver exam application.
  2. The programme reviewed the finding and decided to accept it even though the asset was out of scope, on the grounds that the risk to customers was real.
  3. With the researcher's help, the third party vendor was able to resolve the vulnerability.
  4. The programme shared the researcher's personal information with the vendor to be transparent and in case the vendor wanted to thank him directly.

The outcome recorded by the platform is a medium severity rating, a bounty of 250.00 USD, and disclosure on 2017-11-30. The weakness is classified as generic cross-site scripting. The programme's summary thanks the researcher and says it looks forward to further reports.

Root cause

The report does not describe the code path involved. Based on the finding being a stored XSS in a comments feature, the likely cause is that user-supplied comment content was saved and later rendered into a page without adequate output encoding, so markup submitted as a comment was interpreted by the browser as HTML rather than displayed as text. The report does not say whether the failure was missing encoding on output, missing sanitisation on input, or both.

Impact

Because the payload is stored, it would be served to other users who view the affected comments, not only to the person who submitted it. The programme's own summary frames the risk as being to Grab's customers, which is why it accepted an out-of-scope report. Any statement about session theft, account takeover or administrative access would go beyond what is written here.

How this kind of bug works

Stored XSS arises when an application persists data that a user controls and later includes that data in an HTML response without context-appropriate encoding. The browser cannot tell stored data from the page's own markup, so any script the data contains runs in the origin of the application, with the privileges of whoever loads the page.

The comments feature is a classic carrier: the input is accepted from one user, stored in a database, and rendered to many others. The dangerous step is almost always the rendering, not the storage. Encoding at output, using the correct context (HTML body, attribute, URL, JavaScript string), neutralises the payload at the point where it would otherwise become active. Input filtering and sanitisation can reduce the attack surface but are fragile on their own, because they must anticipate every encoding trick the browser will accept.

Defences that stop this class are output encoding by default in the templating layer, a Content Security Policy that restricts inline and third-party script, and treating all stored user content as untrusted at render time regardless of how it was validated on the way in.

How to test for it

  1. Map every place where user-controlled content is stored and later displayed to another user or to yourself in a different context: comments, profiles, support tickets, names, file descriptions, review fields.
  2. Submit a distinctive marker value first, for example a unique string, and confirm where and how it is reflected after storage. Note the exact context: inside a paragraph, inside an attribute, inside a script block, inside a URL.
  3. Send a payload appropriate to that context and reload the page that renders the stored value. A positive result is the browser executing your script in the application's origin, evidenced by a dialog, a callback to a listener you control, or a DOM change you can observe.
  4. Test the rendering path of a second user or a privileged view where possible, since stored XSS often matters most when it reaches someone other than the author.
  5. Check whether the value is transformed on the way in or out: HTML-encoded characters that display literally indicate encoding is working; characters that survive as markup indicate it is not.

Common false positives are payloads that appear in the response but are encoded, payloads that execute only in your own browser through a client-side sink you introduced, and reflections that occur in a context where the browser will not run script, such as inside a quoted attribute that is properly escaped. Confirm execution in a clean session before reporting.

How it is fixed

Apply context-aware output encoding wherever stored data is rendered, so that user content is treated as text. Where rich text is a product requirement, sanitise with a maintained HTML sanitiser that uses an allowlist of elements and attributes, and run it on output as well as input. Add a Content Security Policy that blocks inline script and unexpected script sources. Set session cookies with HttpOnly and SameSite attributes to limit what script in the page can reach. Review the storage layer for fields that were assumed safe because they were validated at input time.

Hunting notes

Stored XSS tends to hide in features that mix user content with presentation: comment threads, user profiles, notification emails rendered as HTML, admin dashboards that display submitted data, and any field that is written once and read in several templates. Third party applications embedded in a larger estate are a frequent source, as this report illustrates: a vendor product used by the programme may not have received the same review as first-party code.

Recon signals worth following are forms that accept free text and pages that render it back, parameters that persist across requests, and applications where the same value appears in more than one view. When you find a candidate, demonstrate execution with a minimal payload and capture the request and response that show storage and rendering. Explain who else can see the stored value and what the script could do in that context, because that is what turns a technical finding into an accepted report, including, as here, one that a programme may choose to accept outside its stated scope.

A note on handling: the programme shared the researcher's personal information with the vendor, stating it did so for transparency.

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

What happened, in plain words

This report is about a stored cross-site scripting (XSS) bug in a comments feature of a driver exam web application. That application is a third party product used by Grab, and it sits outside the scope defined by the bug bounty programme. The researcher, paresh_parmar, reported it anyway, and the programme accepted it as an exception to its policy because it judged the stored XSS to be a real risk for its customers.

A few terms first, because the rest of the article depends on them:

  • A bug bounty programme is a scheme where a company invites outside people to look for security problems in its systems and pays for good reports. The scope is the list of systems the company says are fair game. Anything not on the list is out of scope.
  • Cross-site scripting (XSS) is a class of bug where an attacker gets their own code (usually JavaScript, the language browsers run inside web pages) to run inside someone else's web page. The browser then treats that code as part of the site.
  • Stored XSS is the version where the malicious content is saved by the application, for example as a comment, and later shown to other people. The attack does not need a special link: anyone who opens the page with the saved content is affected.

A comment here is the everyday feature you know from any website: a box where a user types text and it is saved and shown to others. The report title refers to comments in a driver exam application.

The report itself is short and does not include the request, the payload, the affected endpoint or the response. What it does record is the sequence of events:

  1. The researcher identified a stored XSS in the comments of the driver exam application.
  2. The programme reviewed the finding and decided to accept it even though the asset was out of scope, on the grounds that the risk to customers was real.
  3. With the researcher's help, the third party vendor was able to resolve the vulnerability.
  4. The programme shared the researcher's personal information with the vendor to be transparent and in case the vendor wanted to thank him directly.

The outcome recorded by the platform is a medium severity rating, a bounty of 250.00 USD, and disclosure on 2017-11-30. The weakness is classified as generic cross-site scripting. The programme's summary thanks the researcher and says it looks forward to further reports.

Root cause

The report does not describe the code path involved. Based on the finding being a stored XSS in a comments feature, the likely cause is that user-supplied comment content was saved and later rendered into a page without adequate output encoding, so markup submitted as a comment was interpreted by the browser as HTML rather than displayed as text. The report does not say whether the failure was missing encoding on output, missing sanitisation on input, or both.

To see why this matters, think of a web page as a set of instructions the browser follows. Some of those instructions say "show this text". Others say "run this code". When a site takes a comment and drops it into the page without marking it as plain text, the browser cannot tell the difference between the site's own instructions and the commenter's. If the comment contains something that looks like an instruction, the browser obeys it.

Impact

Because the payload is stored, it would be served to other users who view the affected comments, not only to the person who submitted it. The programme's own summary frames the risk as being to Grab's customers, which is why it accepted an out-of-scope report. Any statement about session theft, account takeover or administrative access would go beyond what is written here.

How this kind of bug works

In general, stored XSS arises when an application persists data that a user controls and later includes that data in an HTML response without context-appropriate encoding. The browser cannot tell stored data from the page's own markup, so any script the data contains runs in the origin of the application, with the privileges of whoever loads the page.

The comments feature is a classic carrier: the input is accepted from one user, stored in a database, and rendered to many others. The dangerous step is almost always the rendering, not the storage. Encoding at output, using the correct context (HTML body, attribute, URL, JavaScript string), neutralises the payload at the point where it would otherwise become active. Input filtering and sanitisation can reduce the attack surface but are fragile on their own, because they must anticipate every encoding trick the browser will accept.

Defences that stop this class are output encoding by default in the templating layer, a Content Security Policy that restricts inline and third-party script, and treating all stored user content as untrusted at render time regardless of how it was validated on the way in.

How to test for it

In general, a tester works through the following steps:

  1. Map every place where user-controlled content is stored and later displayed to another user or to yourself in a different context: comments, profiles, support tickets, names, file descriptions, review fields.
  2. Submit a distinctive marker value first, for example a unique string, and confirm where and how it is reflected after storage. Note the exact context: inside a paragraph, inside an attribute, inside a script block, inside a URL.
  3. Send a payload appropriate to that context and reload the page that renders the stored value. A positive result is the browser executing your script in the application's origin, evidenced by a dialog, a callback to a listener you control, or a DOM change you can observe.
  4. Test the rendering path of a second user or a privileged view where possible, since stored XSS often matters most when it reaches someone other than the author.
  5. Check whether the value is transformed on the way in or out: HTML-encoded characters that display literally indicate encoding is working; characters that survive as markup indicate it is not.

Common false positives are payloads that appear in the response but are encoded, payloads that execute only in your own browser through a client-side sink you introduced, and reflections that occur in a context where the browser will not run script, such as inside a quoted attribute that is properly escaped. Confirm execution in a clean session before reporting.

How it is fixed

In general, the fix is to apply context-aware output encoding wherever stored data is rendered, so that user content is treated as text. Where rich text is a product requirement, sanitise with a maintained HTML sanitiser that uses an allowlist of elements and attributes, and run it on output as well as input. Add a Content Security Policy that blocks inline script and unexpected script sources. Set session cookies with HttpOnly and SameSite attributes to limit what script in the page can reach. Review the storage layer for fields that were assumed safe because they were validated at input time.

Hunting notes

In general, stored XSS tends to hide in features that mix user content with presentation: comment threads, user profiles, notification emails rendered as HTML, admin dashboards that display submitted data, and any field that is written once and read in several templates. Third party applications embedded in a larger estate are a frequent source, as this report illustrates: a vendor product used by the programme may not have received the same review as first-party code.

Recon signals worth following are forms that accept free text and pages that render it back, parameters that persist across requests, and applications where the same value appears in more than one view. When you find a candidate, demonstrate execution with a minimal payload and capture the request and response that show storage and rendering. Explain who else can see the stored value and what the script could do in that context, because that is what turns a technical finding into an accepted report, including, as here, one that a programme may choose to accept outside its stated scope.

A note on handling: the programme shared the researcher's personal information with the vendor, stating it did so for transparency.

Glossary

  • Bug bounty programme: a scheme where a company invites outside researchers to find security problems and pays for valid reports.
  • Scope: the list of systems a programme says are fair game for testing.
  • Out of scope: a system that is not on that list.
  • Cross-site scripting (XSS): a bug where an attacker's code runs inside another site's page in a victim's browser.
  • Stored XSS: XSS where the malicious content is saved by the application and later shown to other users.
  • Payload: the piece of input an attacker submits to trigger a bug.
  • Endpoint: the specific address on a server that a request is sent to.
  • Request: the message a browser sends to a server asking for a page or sending data.
  • Response: the message a server sends back.
  • HTML: the language that describes the structure and content of a web page.
  • Markup: text written in HTML-like syntax that a browser interprets as structure rather than plain text.
  • JavaScript: the programming language browsers run inside web pages.
  • Output encoding: converting stored data so the browser displays it as text instead of interpreting it as markup.
  • Sanitisation: cleaning user input by removing or neutralising dangerous parts.
  • Context: the place in a page where data is inserted (body text, attribute, URL, script), which determines the correct encoding.
  • Templating layer: the part of a web application that builds pages from data and templates.
  • Content Security Policy (CSP): a set of rules a site sends to the browser saying which scripts may run.
  • Session cookie: a small piece of data a site stores in the browser to remember who you are after you log in.
  • HttpOnly: a cookie setting that stops JavaScript in the page from reading the cookie.
  • SameSite: a cookie setting that limits when the cookie is sent with requests from other sites.
  • DOM: the browser's in-memory model of the page, which scripts can read and change.
  • False positive: a finding that looks like a bug but is not actually exploitable.
  • Triage: the process a programme uses to review and prioritise incoming reports.
  • Severity: a rating of how serious a finding is, here medium.
  • Bounty: the money paid for a valid report, here 250.00 USD.
  • Disclosure: the date a report is made public, here 2017-11-30.

More by paresh_parmar

View all

11 more disclosed reports, best first.

More from Grab

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.