Skip to content
XSS Write-up Beginner

$3133.7 Google Bug Bounty Writeup- XSS Vulnerability!

A URL parameter on a Google subdomain was reflected into the page, allowing an attacker to inject script that runs in a victim's browser. The author found a DOM-based cross-site scripting flaw and was paid a bounty.

Pethuraj M Follow

Published on pethuraj.com

Bounty$3,134 View original

This is one of my interesting writeup for the vulnerability I found on one of Google’s sub domains.

admin, on pethuraj.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

This write-up covers a DOM-based cross-site scripting issue found on a Google subdomain. The target was https://tez.google.com/, which the author notes is now Google Pay. The feature involved is a referrer_id parameter that appears in URLs on the subdomain and is passed with values. The author does not describe what the parameter is meant to do beyond carrying a referrer id, so the intended business function is not stated in the report.

The author's stated motivation was to earn bounties and to be added to Google's Bughunter Hall of Fame Security Researchers list.

Setup

The report does not describe any accounts, roles or special preconditions. The work was reconnaissance and manual testing against a public Google subdomain. The tools named are:

  • Knock Subdomain Scan
  • Sublist3r
  • other recon tools (unnamed)
  • Google search dorks

No versions are given.

Finding it

The author began with subdomain enumeration against Google using Knock Subdomain Scan, Sublist3r and other recon tools.

From the original on pethuraj.com

Among the subdomains collected, the author visited https://tez.google.com/ and noticed parameters in the URL containing referrer ids passing values.

To find more instances of the parameter, the author used a Google dork to filter search results for the subdomain:

Text
site:tez.google.com inurl:referrer_id=

This returned some of the referrer_id values in the search results.

From the original on pethuraj.com

The author then tried all the possible ways to exploit the publicly visible referrer_id values and found nothing. What changed the direction was noticing that the referrer_id values were being reflected in part of the web page.

From the original on pethuraj.com

Exploitation

Step 1: Confirm reflection

The author observed that a referrer_id value taken from the URL appeared in the page content. The report does not show the exact request, the parameter placement or the surrounding markup.

Step 2: Pop an XSS payload

Having a reflection point, the author tried an XSS payload and it executed. The report does not reproduce the payload or the URL used.

From the original on pethuraj.com

Step 3: Report and triage

The finding was reported to Google under its Vulnerability Reward Program (VRP). Google triaged the report soon after and asked the author to wait for the bounty amount and Hall of Fame entry.

From the original on pethuraj.com

Step 4: Reward

After some days the author received mail from the Google Security Team stating a reward of $3133.7, classified as a DOM-based XSS.

From the original on pethuraj.com

According to Google's VDP, the report fell into the category shown below, which corresponds to the $3133.7 bounty.

From the original on pethuraj.com

Alongside the bounty, the author was added to the Google Hall of Fame, ranked 253 among 800 other security researchers.

From the original on pethuraj.com

Root cause

The report classifies the issue as DOM-based XSS. The exact sink is not shown in the report, so the precise mechanism is not documented here. The exact sink (for example, an HTML injection point or a JavaScript context) is not shown in the report, so the precise mechanism is not documented here.

Impact

Because the payload executes in the page context, an attacker who can get a victim to open a crafted URL containing a malicious referrer_id value could run script in the victim's session on tez.google.com. The bounty classification as DOM-based XSS is the only severity signal given; no CVSS score is provided.

Fix

Google's remediation is not described in the report. The report only records that the issue was triaged and rewarded. What should be done, in general terms, is to ensure the referrer_id value is not written into the DOM without context-appropriate encoding, and to validate it against an expected format before use.

Variants to test

  1. Enumerate subdomains with Knock Subdomain Scan and Sublist3r, then look for URL parameters that carry ids or referrer values.
  2. Use a dork such as site:<target> inurl:<param>= to collect real values of the parameter from indexed pages. A positive result is a set of live URLs with the parameter populated.
  3. Load those URLs and inspect the rendered page for the parameter value appearing in the DOM. A positive result is the value reflected in the page source or DOM.
  4. Replace the value with an XSS payload and observe whether it executes. A positive result is script execution in the page context, which is what the author confirmed here.

The report does not provide the payload or the exact URL used, so those cannot be reproduced from this text.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

What happened, in plain words

A security researcher found a bug on a Google website. The website was https://tez.google.com/, a Google service that the author notes is now called Google Pay. The bug was a type called cross-site scripting, or XSS for short. In simple terms, XSS means a website can be tricked into running small pieces of code that an attacker wrote, as if the website itself had written them. Imagine a noticeboard where visitors can pin notes. If the board copies whatever a visitor writes onto an official-looking sign without checking it, a visitor could write something that looks like an official instruction. XSS is the web version of that: the site takes text from the address bar and puts it into the page without checking it, so the text can include code.

The researcher found that a value called referrer_id, which appears in the web address (the URL), was being copied into the page. When the researcher replaced that value with a test payload, the code ran. That confirmed the bug. Google reviewed the report, classified it as a DOM-based XSS, and paid a bounty of $3133.7. The researcher was also added to Google's Hall of Fame for security researchers, ranked 253 among 800.

The author's stated reason for testing Google was to earn bounties and to get a place on Google's Bughunter Hall of Fame Security Researchers list.

Background ideas you need first

Before walking through the steps, here are the few ideas the rest of the article relies on.

  • Subdomain: A subdomain is a smaller name in front of a main domain. If google.com is a big building, tez.google.com is one office inside it. Each subdomain can be a different service with its own code, so a bug in one office does not automatically mean a bug in the others.
  • URL and parameters: A URL is the address you type or click, like https://tez.google.com/. A parameter is an extra piece of information attached to the address after a question mark, written as name=value. For example, ?referrer_id=123 means "the parameter called referrer_id has the value 123". Websites use parameters to pass small pieces of data between pages.
  • Referrer id: A referrer id is an identifier for whoever sent a visitor to the page, for example a partner or a campaign. The report only says the parameter carries referrer ids; it does not explain what the site does with them beyond that.
  • Reflection: Reflection means the website takes a value from the URL and writes it back into the page you see. If you put your name in the address and the page then shows "Hello, your name", that value has been reflected. Reflection is not automatically a bug, but it becomes dangerous when the value is written into the page without being made safe.
  • DOM: The DOM (Document Object Model) is the browser's live model of the page: the structure of headings, text, links and scripts that the browser builds and that JavaScript can change. When a page is changed by code running in the browser rather than by the server sending different HTML, people say the change happens "in the DOM".
  • DOM-based XSS: This is XSS where the dangerous copying happens in the browser, in JavaScript, rather than on the server. The server may send the same page to everyone; the browser-side code reads the URL and inserts part of it into the page. If that insertion is not made safe, the inserted text can include code.
  • Payload: A payload is the test input an attacker or researcher sends to see whether a bug is real. For XSS, a payload is a small piece of code that, if it runs, proves the site is executing input it should not.
  • Bounty and VRP/VDP: A bug bounty is a reward a company pays for a responsibly reported security bug. Google runs this through its Vulnerability Reward Program (VRP); the report also refers to Google's Vulnerability Disclosure Program (VDP) when describing the reward category. Both names point to the same idea: report the bug privately, the company checks it, and pays according to a published scale.
  • Triage: Triage is the first review step. The company's security team confirms the report is real and decides how serious it is before assigning a reward.
  • Hall of Fame: A public list of researchers who have reported valid bugs, used as recognition.

Finding it

The author started with reconnaissance. Reconnaissance (recon) means gathering information about a target before testing it, the way you might walk around a building and note the doors before trying any of them. The tools named in the report are:

  • Knock Subdomain Scan
  • Sublist3r
  • other recon tools (not named)
  • Google search dorks

No versions are given. The purpose of these tools is to discover subdomains: they try many possible names and keep the ones that exist. This step was taken because each subdomain is a separate service, and a researcher wants a list of services to look at rather than only the main website.

From the original on pethuraj.com

Among the subdomains collected, the author visited https://tez.google.com/ and noticed parameters in the URL containing referrer ids passing values. In other words, the address bar contained a referrer_id parameter with some value in it. That is interesting to a tester because anything that comes in through the URL is input the visitor controls, and input the visitor controls is where injection bugs live.

To find more examples of the parameter in use, the author used a Google search dork. A dork is a search query with special operators that narrow results in a precise way. The one used here was:

Text
site:tez.google.com inurl:referrer_id=

Line by line:

  • site:tez.google.com tells Google to return only pages from that subdomain. It is a filter on the search engine, not a request to the site itself.
  • inurl:referrer_id= tells Google to return only pages whose address contains the text referrer_id=. This finds pages where the parameter is present in the URL.
  • Together, the query asks: show me indexed pages on tez.google.com whose addresses contain referrer_id=.

This returned some of the referrer_id values in the search results.

From the original on pethuraj.com

The reason for this step is to collect real, working values of the parameter. Real values show the format the site expects and give you URLs you know the site has produced itself, which are good starting points for testing.

The author then tried all the possible ways to exploit the publicly visible referrer_id values and found nothing. What changed the direction was noticing that the referrer_id values were being reflected in part of the web page. That is the key observation: the value from the address bar was appearing in the page content. Once a value is reflected, the question becomes whether the site makes it safe before writing it into the page.

From the original on pethuraj.com

Exploitation

Step 1: Confirm reflection

The author observed that a referrer_id value taken from the URL appeared in the page content. The report does not show the exact request, the parameter placement or the surrounding markup. The reason this step matters is that reflection is the precondition for this kind of XSS: without the value reaching the page, there is nothing to inject into.

Step 2: Pop an XSS payload

Having a reflection point, the author tried an XSS payload and it executed. The report does not reproduce the payload or the URL used. The idea is simple: if the page copies your input into the page, send input that is not just text but code, and see whether the browser runs it. If it runs, the site is treating visitor input as trusted content, which is the bug.

From the original on pethuraj.com

Step 3: Report and triage

The finding was reported to Google under its Vulnerability Reward Program (VRP). Google triaged the report soon after and asked the author to wait for the bounty amount and Hall of Fame entry. Reporting privately first is the normal practice: it gives the company time to fix the issue before anyone can abuse it.

From the original on pethuraj.com

Step 4: Reward

After some days the author received mail from the Google Security Team stating a reward of $3133.7, classified as a DOM-based XSS. The classification matters because it tells you the bug was classed as DOM-based XSS, where the unsafe copying happens in the browser rather than on the server.

From the original on pethuraj.com

According to Google's VDP, the report fell into the category shown below, which corresponds to the $3133.7 bounty.

From the original on pethuraj.com

Alongside the bounty, the author was added to the Google Hall of Fame, ranked 253 among 800 other security researchers.

From the original on pethuraj.com

Root cause

The report classifies the issue as DOM-based XSS. The exact sink is not shown in the report, so the precise mechanism is not documented here. The exact sink (for example, an HTML injection point or a JavaScript context) is not shown in the report, so the precise mechanism is not documented here.

In plain terms: a value from the address bar ended up in the page as if it were part of the page's own content. When you place text into a page, you have to make it safe for the place it lands in. Text placed inside HTML needs characters like < and > turned into harmless codes so they display as text instead of starting a tag. Text placed inside a script needs different handling again. If that step is skipped, the text can become structure or code.

Impact

Because the payload executes in the page context, an attacker who can get a victim to open a crafted URL containing a malicious referrer_id value could run script in the victim's session on tez.google.com. The bounty classification as DOM-based XSS is the only severity signal given; no CVSS score is provided.

A useful comparison: a crafted URL is like a letter with a hidden instruction. If the site reads the instruction out loud as if it wrote it itself, the browser obeys it, and the browser is already logged in as the victim. That is why XSS is taken seriously even when the page looks harmless.

Fix

Google's remediation is not described in the report. The report only records that the issue was triaged and rewarded. What should be done, in general terms, is to ensure the referrer_id value is not written into the DOM without context-appropriate encoding, and to validate it against an expected format before use. In everyday terms: check that the value looks like an id (for example, only letters and digits of a known length), and when you do place it in the page, convert any special characters so they can only ever be displayed as text, never interpreted as structure or code.

Variants to test

If you want to practise the same approach on a target you are allowed to test, the sequence is:

  1. Enumerate subdomains with Knock Subdomain Scan and Sublist3r, then look for URL parameters that carry ids or referrer values. Why: more subdomains means more separate services, and parameters are visitor-controlled input.
  2. Use a dork such as site:<target> inurl:<param>= to collect real values of the parameter from indexed pages. A positive result is a set of live URLs with the parameter populated. Why: real values show the expected format and give you URLs the site itself has produced.
  3. Load those URLs and inspect the rendered page for the parameter value appearing in the DOM. A positive result is the value reflected in the page source or DOM. Why: reflection is the precondition for this class of bug.
  4. Replace the value with an XSS payload and observe whether it executes. A positive result is script execution in the page context, which is what the author confirmed here. Why: execution is the proof that the site treats the input as trusted content.

The report does not provide the payload or the exact URL used, so those cannot be reproduced from this text.

Glossary

  • Bounty: A reward a company pays for a valid security bug reported responsibly.
  • Bug bounty program: A company scheme that sets out what kinds of bugs are in scope and how much they are worth.
  • Cross-site scripting (XSS): A bug where a site runs code supplied by a visitor as if the site had written it.
  • DOM (Document Object Model): The browser's live model of the page, which JavaScript can read and change.
  • DOM-based XSS: XSS where the unsafe copying of input into the page happens in browser-side code rather than on the server.
  • Dork: A search query using special operators to narrow results precisely.
  • Hall of Fame: A public list recognising researchers who reported valid bugs.
  • Parameter: A name=value pair attached to a URL after a question mark, used to pass data to a page.
  • Payload: The test input sent to check whether a bug is real; for XSS, a small piece of code.
  • Reconnaissance (recon): Gathering information about a target before testing it.
  • Reflection: A website writing a value from the URL back into the page it shows.
  • Sink: The place in code where input is finally used, such as where it is written into the page.
  • Subdomain: A named service in front of a main domain, such as tez.google.com under google.com.
  • Triage: The first review of a report, where the company confirms it and assesses severity.
  • URL: The address of a page, including any parameters.
  • VDP (Vulnerability Disclosure Program): A company programme for receiving and handling security reports; the report uses this name when describing the reward category.
  • VRP (Vulnerability Reward Program): Google's bug bounty programme, under which this report was handled.

More from Google

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.