Skip to content
XSS Write-up Beginner

$100 Bounty in 300 seconds isn’t bad !!!

Rohan Chavan Follow

Published on medium.com

Bounty$100 View original

{{media:0}}

Rohan Chavan, on medium.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. 5 min read.

Context

Zoho runs a bug bounty programme, and this write-up covers a stored cross-site scripting (XSS) finding in one of its subdomains. The researcher had not known the programme existed until he saw a Zoho leaderboard post in a bug bounty hunters group on Facebook, then went to the programme page to read the scope.

The feature involved is a calendar on the Zoho dashboard. After signing up and landing on the dashboard, the researcher saw three main options: campaigns, enterprise, and a third one he chose not to name. Clicking a date opens a modal box with an option to mark that date, and that option leads to another page where the user can write a title, add an action and enter notes. After submitting the form, the title he had written appeared on the calendar date inside a blue strip, and clicking it reopened the same modal with the details he had entered.

Setup

No special accounts or roles were needed. The researcher created a normal account on the Zoho website and landed on the dashboard. The only tool mentioned is Burp, and notably the researcher says he was not yet analysing requests in Burp at the point of discovery: he was just clicking around the interface. No versions are given.

Finding it

Out of curiosity the researcher started testing the calendar, clicking here and there without intercepting traffic. Clicking one of the dates produced a modal box with an option to mark that date.

Image for post
Image for post From the original on medium.com

That button led to another page with fields for a title, an action and notes. He first tried some SQL injection and XSS payloads quickly, without success, and kept putting XSS payloads into every text input available. He entered the XSS payload again in the notes input and submitted the form, but nothing happened and he was returned to the calendar page.

What made the difference was noticing that the title he had written was displayed on the calendar date within a blue strip. He had not checked that view yet, so he clicked it. The same modal popped up again, showing the details he had entered, and still no XSS popup fired.

Image for post
Image for post From the original on medium.com

Exploitation

Step 1: mark a date and open the entry form

From the dashboard calendar, clicking a date opens a modal with an option to mark the date. That option leads to a page with title, action and notes inputs.

Step 2: submit a payload in the notes field

The researcher placed an XSS payload in the notes input and submitted the form. The submission returned him to the calendar page with no execution. The report does not reproduce the exact payload string.

Step 3: reopen the entry from the calendar

The title appeared on the calendar date inside a blue strip. Clicking it reopened the modal with the stored details. No popup at this stage either.

Step 4: click the action

The modal contained a small action rendered in blue. Clicking that action triggered the XSS. The researcher notes it was not even more than five minutes before he found something.

Because the bug sat in the action of a calendar entry, he hoped it would fire on its own, which would have made it a self-triggering payload, but it did not: execution required the click on the action. The report does not show the request or response that carried the payload, nor the exact JavaScript that ran.

Image for post
Image for post From the original on medium.com

Root cause

The report does not analyse the server-side or client-side code, so the precise mistake is not documented. What the behaviour shows is that user-supplied content stored with a calendar entry was later rendered into the page and executed when the action was clicked, rather than being output-encoded or otherwise neutralised at that point. The fact that the payload did not fire when the modal first displayed the stored details, but did fire on the action click, suggests the action handling rendered the stored value in a context where script could execute. That is an inference from the observed behaviour, not something the report states.

Impact

This is a stored XSS: the payload persists with the calendar entry and executes in the browser of whoever triggers the action. The report does not describe any cross-user scenario, any victim other than the researcher, or what an attacker could achieve beyond script execution in that context. The researcher himself considered $100 low for a stored XSS, while acknowledging the find was a lucky catch that took little effort.

Fix

The general remedy for this class of bug is to encode or sanitise stored values at every point where they are rendered, including the action handling, rather than relying on the field being safe in one view.

Timeline

Event Date
Reported 22/08/18
Acknowledged by team Aug 24, 2018 12:27:10 PM
200 points awarded and bug closed Aug 27, 2018 8:01:22 PM
Bounty of $100 awarded Aug 31, 2018 6:22:47 PM

The report says he was awarded a bounty of $100 and 200 points and HOF.

Variants to test

  1. Store a payload in every text field of a record (title, notes, action) and then view the record in each place it is rendered: list view, detail modal, and any inline action control. A positive result is script execution from one of those render points even though another render point was safe.
  2. Test action and button labels that are built from stored data. A positive result is execution when the action is clicked, as here.
  3. Try payloads that fire without user interaction, to see whether the stored value is rendered on page load. A positive result is execution as soon as the calendar or record view opens.
  4. Repeat the same payloads in other tenants of the same product, since a stored value may be rendered by a different component in each view.

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

What happened, in plain words

A security researcher found a bug in a Zoho website. The bug let him save a small piece of JavaScript code (the language web pages use to make things happen in your browser) into a calendar entry, and then have that code run in his browser when he clicked a button. This kind of bug is called stored cross-site scripting, or stored XSS. "Stored" means the dangerous text is saved on the website's server and comes back later; "cross-site scripting" means a browser is tricked into running code that the website's owners did not intend to run.

He reported it to Zoho's security team, and they paid him $100, gave him 200 points on their bug bounty platform and added him to their hall of fame. A bug bounty programme is a scheme where a company pays people for finding and reporting security problems instead of punishing them. A hall of fame is a public list of researchers who have reported valid bugs.

He notes it was not even more than five minutes before he found something, which is where the "300 seconds" in the title comes from.

Background: what Zoho is and what the calendar does

Zoho is a company that makes online business software. The researcher had not known Zoho ran a bug bounty programme until he saw someone post a Zoho leaderboard screenshot in a bug bounty hunters group on Facebook. A leaderboard is a ranking of researchers by points or bounties. He then went to Zoho's programme page to read the scope, which is the list of websites and features a company says are fair game to test.

He signed up for a normal account on the Zoho website and landed on the dashboard. A dashboard is the first screen you see after logging in, usually a summary of your account with links to the main features. He saw three main options: campaigns, enterprise, and a third one he chose not to name in the write-up.

One of the things on the dashboard was a calendar. A calendar is a familiar grid of days; in a web app, each day is usually a clickable element. Clicking a date opened a modal box, which is a small window that appears on top of the page and dims the rest, asking you to do something before you continue. In this modal there was an option to mark that date.

Clicking the option to mark the date took him to another page with a title, an action and notes. A field is just an input box on a form. After he submitted the form, the title he had written appeared back on the calendar, on the date he had marked, inside a blue strip. Clicking it reopened the same modal, which showed the details he had entered.

Setup

No special account or permission was needed. He created an ordinary account and used the dashboard like any customer would. The only tool mentioned in the write-up is Burp, short for Burp Suite, a program that sits between your browser and a website and lets you read and change the requests going back and forth. A request is the message your browser sends to a server asking for a page or sending data; the response is what the server sends back. Importantly, he says he was not yet analysing requests in Burp when he found the bug: he was only clicking around the interface. No software versions are given.

Finding it

Out of curiosity he started testing the calendar, clicking here and there without intercepting traffic. Intercepting means catching a request in a tool like Burp so you can inspect it before it reaches the server. Clicking one of the dates produced the modal box with the option to mark that date.

Image for post
Image for post From the original on medium.com

That button led to the page with the title, action and notes fields. He first tried some SQL injection and XSS payloads quickly, without success. SQL injection is a different bug class where text typed into a form is interpreted as database commands; it is not the bug he eventually found. A payload is the specific piece of text an attacker sends to try to trigger a bug. He kept putting XSS payloads into every text input available, on the reasoning that you never know when you might get lucky. He entered the XSS payload again in the notes input and submitted the form, but nothing happened and he was sent back to the calendar page.

What made the difference was noticing that the title he had written was displayed on the calendar date inside a blue strip. He had not looked at that view yet, so he clicked it. The same modal popped up again, showing the details he had entered, and still no XSS popup fired. A popup here means the browser alert box that a test payload typically makes appear, which is the simplest proof that code ran.

Image for post
Image for post From the original on medium.com

Exploitation

Step 1: mark a date and open the entry form

From the dashboard calendar, clicking a date opens a modal with an option to mark the date. That option leads to a page with title, action and notes inputs. He did this simply to see what the feature did, because understanding how a feature works is the first step to guessing where it might mishandle what you type.

Step 2: submit a payload in the notes field

The researcher placed an XSS payload in the notes input and submitted the form. The submission returned him to the calendar page with no execution. The write-up does not reproduce the exact payload string, so there is no code to show for this step.

Why this step: a form that saves what you type is the classic place to look for stored XSS, because whatever you enter is kept on the server and shown again later. If the site shows it back without neutralising it, the code can run.

Step 3: reopen the entry from the calendar

The title appeared on the calendar date inside a blue strip. Clicking it reopened the modal with the stored details. No popup at this stage either. This told him the stored value was being displayed in at least two places, and that the first place was safe.

Step 4: click the action

The modal contained a small action rendered in blue. Clicking that action triggered the XSS. The researcher notes it was not even more than five minutes before he found something.

Because the bug sat in the action of a calendar entry, he hoped it would fire on its own, which would have made it a self-triggering payload: one that runs as soon as the page loads, with no click needed. It did not. Execution required the click on the action. The write-up does not show the request or response that carried the payload, nor the exact JavaScript that ran.

Image for post
Image for post From the original on medium.com

Root cause

The write-up does not analyse the server-side or client-side code, so the precise mistake is not documented. What the behaviour shows is that content supplied by the user and stored with a calendar entry was later placed into the page and executed when the action was clicked, instead of being output-encoded or otherwise neutralised at that point. Output encoding means converting characters that have special meaning in a web page, such as < and >, into harmless equivalents so the browser shows them as text rather than treating them as code.

The fact that the payload did not fire when the modal first displayed the stored details, but did fire on the action click, suggests the action handling placed the stored value in a context where script could execute. That is an inference from what was observed, not something the write-up states.

Impact

This is a stored XSS: the payload persists with the calendar entry and runs in the browser of whoever triggers the action. The write-up does not describe any scenario involving another user, any victim other than the researcher, or what an attacker could achieve beyond script execution in that context. The researcher himself considered $100 low for a stored XSS, while acknowledging the find was a lucky catch that took little effort.

Fix

The general remedy for this class of bug is to encode or sanitise stored values at every point where they are shown, including the action handling, rather than relying on the field being safe in one view. Sanitising means cleaning input so that dangerous parts are removed or defused before it is stored or displayed.

Timeline

Event Date
Reported 22/08/18
Acknowledged by team Aug 24, 2018 12:27:10 PM
200 points awarded and bug closed Aug 27, 2018 8:01:22 PM
Bounty of $100 awarded Aug 31, 2018 6:22:47 PM

The report says he was awarded a bounty of $100 and 200 points and HOF.

Variants to test

These are follow-up ideas in the same spirit, for someone repeating the exercise on a similar feature:

  1. Store a payload in every text field of a record (title, notes, action) and then view the record in each place it is shown: list view, detail modal, and any inline action control. A positive result is code running from one of those display points even though another display point was safe.
  2. Test action and button labels that are built from stored data. A positive result is execution when the action is clicked, as here.
  3. Try payloads that fire without user interaction, to see whether the stored value is shown on page load. A positive result is execution as soon as the calendar or record view opens.
  4. Repeat the same payloads in other accounts of the same product, since a stored value may be shown by a different component in each view.

Glossary

  • Bug bounty programme: a scheme where a company pays researchers for reporting security problems in its systems.
  • Stored XSS: a bug where dangerous text is saved on a server and later shown to a browser, which then runs it as code.
  • Payload: the specific piece of text sent to try to trigger a bug.
  • Scope: the list of systems and features a company allows researchers to test.
  • Dashboard: the first screen after logging in, summarising the account and linking to its features.
  • Modal box: a small window that appears on top of a page and asks you to act before continuing.
  • Field: an input box on a form.
  • Request: the message a browser sends to a server asking for a page or sending data.
  • Response: what a server sends back to a browser.
  • Burp (Burp Suite): a tool that sits between browser and website so requests can be read and changed.
  • Intercepting: catching a request in a tool before it reaches the server.
  • SQL injection: a bug class where typed text is treated as database commands.
  • Popup: here, the browser alert box a test payload makes appear, proving code ran.
  • Output encoding: converting characters with special meaning in a web page into harmless equivalents so they display as text.
  • Sanitising: cleaning input so dangerous parts are removed or defused.
  • Self-triggering payload: code that runs as soon as a page loads, with no click needed.
  • Hall of fame: a public list of researchers who have reported valid bugs.
  • Leaderboard: a ranking of researchers by points or bounties.

More by Rohan Chavan

View all

1 more disclosed report, best first.

More from Zoho

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.