Skip to content
XSS Disclosed report Beginner

#3 XSS on watchdocs.indriverapp.com

A reflected cross-site scripting flaw existed on a webview endpoint that accepted a JWT parameter and echoed it into the page without proper encoding. An attacker could run JavaScript in a victim's browser by getting them to open a crafted link.

maxdha Follow

Originally disclosed on HackerOne

  • Triaged in 5 hours
  • Fixed in 10 months
  • Paid in 3 days
  • Disclosed after 10 months

Summary by the program

The report

Summary:

Found an XSS

Steps To Reproduce:

  1. Go to https://watchdocs.indriverapp.com/webview/v1/transport-change?phone=██████&token=█████████&service=intercity3&jwt=fw%22%3E%3Cimg%20src=fwa%20onerror=alert(1)%3E

Supporting Material/References:

████

Impact

Execute Javascript on any victim browser

The original report as published on HackerOne, by maxdha. 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 watchdocs.indriverapp.com, a host in the inDrive bug bounty programme, and the URL in the report is under /webview/v1/transport-change. The researcher, maxdha, reported a reflected cross-site scripting issue and the programme rated it low severity. The report itself is very short: a summary line, a single reproduction step and a one-line impact statement.

The reproduction step is a single URL. The payload sits in the jwt parameter, which is URL-encoded, and the other parameters (phone, token, service) are present but not explained. The value supplied for jwt is:

Text
fw%22%3E%3Cimg%20src=fwa%20onerror=alert(1)%3E

Decoded, that is a short string followed by a double quote, a closing angle bracket, and an img tag whose src fails and whose onerror handler calls alert(1). The full request as given in the report is:

The report gives only the URL, with no HTTP method, headers or response body. The researcher's stated impact is executing JavaScript on any victim browser. The report does not describe a fix, a bounty amount or the disclosure timeline beyond the platform metadata.

Root cause

The likely cause is that the value of the jwt parameter is written into the HTML of the webview page without output encoding. The payload begins with a double quote and a > before the img tag, which suggests the value is placed inside an HTML attribute: the quote closes the attribute and the > closes the tag, letting the injected element be parsed as markup. Because the handler fires on a failed image load, no user interaction beyond loading the page is needed. The report does not show the server-side code, so this is inference from the payload shape rather than a confirmed mechanism.

Impact

The report's own claim is script execution in the victim's browser. The report does not demonstrate any such bridge access, so the practical ceiling is unproven. The programme rated the issue low.

How this kind of bug works

Reflected XSS happens when an application takes a value from the request and places it into the response without context-appropriate encoding. The browser cannot tell developer-written markup from injected markup, so any characters that are meaningful in the surrounding context (quotes inside an attribute, angle brackets in element content, </script> inside a script block) can break out and introduce new elements or handlers.

The defence is output encoding matched to context: HTML-entity encoding for element text and attribute values, JavaScript string escaping inside script blocks, URL encoding inside URL contexts, and CSS escaping inside style blocks. A strict Content Security Policy that disallows inline script and on* handlers provides defence in depth, and frameworks that auto-escape by default remove most of this class of bug when used correctly. Input validation helps but is not the primary control, because the same value may be safe in one context and dangerous in another.

How to test for it

  1. Map every parameter that ends up in the response, including ones that look structural, such as tokens, locale flags and redirect targets. Webview and mobile-bridge endpoints are especially worth checking because they often render server-side templates.
  2. Send a benign marker first, for example a unique alphanumeric string, and find where it appears in the response body. Note the surrounding context: attribute value, element text, script block, URL or JSON.
  3. Send context-breaking characters one at a time: a double quote, a single quote, <, >, and a closing script tag. Look for the characters surviving unencoded in the response.
  4. When a break-out is possible, build a minimal proof such as an element with an event handler, and confirm it executes in a real browser, not just that the string is reflected.
  5. Check whether the response is served with a content type that the browser renders as HTML. A reflection in a JSON response with application/json is usually not exploitable.

Common false positives: the payload appears encoded in the body but the tester only searched for the raw string; the reflection lands in a context the browser does not execute; a CSP blocks the handler; or the page is only reachable with a session that the victim would not have.

How it is fixed

Encode every reflected value for the context it lands in, using the templating engine's escaping rather than hand-rolled filters. Where a value must be embedded in JavaScript, serialise it as JSON rather than interpolating it into a string. Add a Content Security Policy that blocks inline handlers and inline script, and set the correct Content-Type and X-Content-Type-Options: nosniff on responses. For webview endpoints, restrict which origins the webview will load and validate any parameters that influence navigation.

Hunting notes

Reflected XSS tends to hide in parameters that developers treat as opaque: tokens, JWTs, tracking identifiers, locale and theme switches, and error or redirect messages. Webview and deep-link endpoints are strong candidates because they often take many parameters and render a template for a mobile client. Recon signals include endpoints with webview, redirect, return, callback or lang in the path or query, and any parameter whose value appears verbatim in the HTML source.

State clearly what an attacker gains: session actions, data visible to the page, or access to a native bridge.

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

What happened, in plain words

This report is about a website called watchdocs.indriverapp.com, which belongs to the inDrive bug bounty programme. A bug bounty programme is a scheme where a company invites outside researchers to look for security problems in its systems and report them, sometimes for a reward. The researcher here is maxdha, and the problem found is a reflected cross-site scripting (XSS) issue, rated low severity.

To understand the bug, start with what the page does. The address in the report points to a path under /webview/v1/transport-change. A webview is a small built-in browser window inside a mobile app: the app shows a web page without opening a separate browser. The address in the report points to a path under /webview/v1/transport-change and carries several values in its address, called parameters. A parameter is a named value attached to a URL after a question mark, like a label on a form field.

The report is short: a summary line, one reproduction step and one line of impact. The reproduction step is a single URL. The interesting part is the jwt parameter. A JWT (JSON Web Token) is normally a signed string used to prove who a user is, similar to a stamped pass. Here the value placed in that parameter is not a real token but a payload, which is the crafted text an attacker sends to try to make the page misbehave. The value is URL-encoded, meaning special characters are written in a percent form so they can travel safely inside an address.

The payload as it appears in the report is:

Text
fw%22%3E%3Cimg%20src=fwa%20onerror=alert(1)%3E

Decoding it step by step:

  • fw is a short piece of ordinary text.
  • %22 is a double quote (").
  • %3E is a closing angle bracket (>).
  • %3Cimg%20src=fwa%20onerror=alert(1)%3E is <img src=fwa onerror=alert(1)>.

So the decoded value is a short string, then a double quote and a >, then an image tag. The image tag points at fwa, which is not a real image, so loading it fails. When an image fails to load, the browser runs whatever is in the onerror attribute. Here that is alert(1), which makes the browser show a small pop-up box containing the number 1. That pop-up is the classic harmless proof that code supplied by an attacker actually ran in the page.

The URL as given in the report is:

phone, token and service are other parameters; the report does not explain what they do, and the first two are redacted here because they look like personal and secret values. service=intercity3 is a plain value. The jwt parameter carries the payload.

The report gives only the URL, with no HTTP method, headers or response body.

Why does this work? A web page is text that the browser reads and turns into elements. If the server takes a value from the address and drops it into that text without cleaning it, the browser cannot tell the developer's own markup from text an attacker supplied. The payload starts with a double quote and a >, which suggests the value is placed inside an HTML attribute: the quote closes the attribute and the > closes the tag, so the image tag that follows is read as a real element. The report does not show the server-side code, so this is an inference from the shape of the payload rather than a confirmed mechanism.

The researcher's stated impact is that JavaScript can be executed in any victim's browser. JavaScript is the programming language that runs inside web pages and can read and change what is on screen. The report does not demonstrate any such access, so how far an attacker could go is not shown. The programme rated the issue low.

In general, how this kind of bug works

Reflected XSS happens when an application takes a value from the request and puts it into the response without encoding it for the place it lands. Encoding means turning characters that have a special meaning into a safe written form, the way you would write a quotation mark in a letter so it is not mistaken for punctuation. The browser cannot tell developer-written markup from injected markup, so any character that is meaningful in the surrounding place (a quote inside an attribute, angle brackets in element text, a closing script tag inside a script block) can break out and add new elements or handlers.

The defence is output encoding matched to context: HTML-entity encoding for element text and attribute values, JavaScript string escaping inside script blocks, URL encoding inside URL contexts, and CSS escaping inside style blocks. A strict Content Security Policy, a set of rules the server sends telling the browser which scripts may run, that disallows inline script and on* handlers adds a second layer. Frameworks that escape by default remove most of this class of bug when used correctly. Input validation helps but is not the main control, because the same value can be safe in one place and dangerous in another.

In general, how to test for it

  1. Map every parameter that ends up in the response, including ones that look structural, such as tokens, locale flags and redirect targets. Webview and mobile-bridge endpoints are especially worth checking because they often render server-side templates.
  2. Send a harmless marker first, for example a unique string of letters and digits, and find where it appears in the response body. Note the surrounding context: attribute value, element text, script block, URL or JSON.
  3. Send context-breaking characters one at a time: a double quote, a single quote, <, >, and a closing script tag. Look for the characters surviving unencoded in the response.
  4. When a break-out is possible, build a minimal proof such as an element with an event handler, and confirm it executes in a real browser, not just that the string is reflected.
  5. Check whether the response is served with a content type that the browser renders as HTML. A reflection in a JSON response with application/json is usually not exploitable.

Common false positives: the payload appears encoded in the body but the tester only searched for the raw string; the reflection lands in a place the browser does not execute; a Content Security Policy blocks the handler; or the page is only reachable with a session the victim would not have.

In general, how it is fixed

Encode every reflected value for the place it lands in, using the templating engine's escaping rather than hand-rolled filters. Where a value must be embedded in JavaScript, serialise it as JSON rather than pasting it into a string. Add a Content Security Policy that blocks inline handlers and inline script, and set the correct Content-Type and X-Content-Type-Options: nosniff on responses. For webview endpoints, restrict which origins the webview will load and validate any parameters that influence navigation.

In general, where to look

Reflected XSS tends to hide in parameters that developers treat as opaque: tokens, JWTs, tracking identifiers, locale and theme switches, and error or redirect messages. Webview and deep-link endpoints are strong candidates because they often take many parameters and render a template for a mobile client. Signals worth watching for include endpoints with webview, redirect, return, callback or lang in the path or query, and any parameter whose value appears verbatim in the HTML source.

State clearly what an attacker gains: session actions, data visible to the page, or access to a native bridge.

Glossary

  • Bug bounty programme: a scheme where a company invites outside researchers to find and report security problems, sometimes for a reward.
  • Cross-site scripting (XSS): a bug where an attacker gets their own code to run inside another person's browser through a trusted website.
  • Reflected XSS: a form of XSS where the attacker's value travels in the request and is echoed straight back in the response.
  • Webview: a small built-in browser window inside a mobile app that shows a web page.
  • Parameter: a named value attached to a URL after a question mark, like a label on a form field.
  • Payload: the crafted text an attacker sends to try to make a system misbehave.
  • URL encoding: writing special characters in a percent form so they can travel safely inside an address.
  • JWT (JSON Web Token): a signed string normally used to prove who a user is.
  • HTTP method: the word at the start of a request, such as GET, that says what kind of action is wanted.
  • Header: an extra line of information sent with a request or response, such as Host.
  • Host: the header that tells the server which site the request is for.
  • HTML attribute: a named setting inside an element tag, such as src or onerror.
  • Event handler: code that runs when something happens, such as an image failing to load.
  • JavaScript: the programming language that runs inside web pages.
  • Output encoding: turning characters with special meaning into a safe written form for the place they land.
  • Content Security Policy: rules the server sends telling the browser which scripts may run.
  • Content type: the label on a response saying what kind of content it is, such as HTML or JSON.
  • JSON: a simple text format for structured data.
  • False positive: a finding that looks like a bug but is not actually exploitable.
  • Severity: a rating of how serious a bug is, often from low to critical.

More by maxdha

View all

3 more disclosed reports, best first.

More from inDrive

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.