Skip to content
XSS Disclosed report Beginner

xss in /browse/contacts/

defmax Follow

Originally disclosed on HackerOne

Bounty$100 View original
  • Triaged in 4 hours
  • Fixed in 12 hours
  • Paid in 12 hours
  • Disclosed after 41 days

hey guys

i just found an xss in openfolio

i just created an contact in google with name as "><img src=x onerror=prompt(1)> and gave an email as random

url >> https://www.google.com/contacts/u/0/#contact/new

then i synced openfolio with google contacts

then i went here >> https://openfolio.com/browse/contacts/

then i clicked on invite of "><img src=x onerror=prompt(1)> , i got the xss popup ~

POC >> http://postimg.org/image/6po3vo89l/

The original report as published on HackerOne, by defmax. 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

Openfolio let users connect their account to Google Contacts and then invite people from that imported list. The invite flow lived at:

Text
https://openfolio.com/browse/contacts/

The researcher created a contact in Google with a script payload as the contact name and a random address as the email:

Text
"><img src=x onerror=prompt(1)>

The contact was created through the Google Contacts interface:

Text
https://www.google.com/contacts/u/0/#contact/new

He then synced Openfolio with Google Contacts, opened the contacts browse page, and clicked the invite control next to the maliciously named contact. The payload executed and a prompt(1) popup appeared, which is the standard proof of script execution in a reflected or stored XSS report.

It does not give a severity rating, a CVSS score, or describe a fix.

Root cause

The report does not describe the cause. A plausible explanation is that the imported contact name was written into the invite page without output encoding. The name is attacker-controlled data that arrives through a third-party sync, so the application treated it as trusted content and rendered it as HTML. When the invite control was clicked, the payload executed and a prompt(1) popup appeared.

Impact

The report only demonstrates a prompt(1) popup, so the confirmed impact is script execution in the Openfolio origin when a user interacts with the invite control for a malicious contact.

How this kind of bug works

Cross-site scripting happens when untrusted data reaches an HTML, attribute, URL or script context without being encoded for that context, so the browser parses part of the data as markup or code. The payload was saved in a synced contact record and rendered when the invite control was clicked, so no crafted link was needed.

Data imported from third-party services is a common source because developers assume it is clean. Google Contacts names, calendar titles, file names, profile display names and similar fields are all attacker-influenced if an attacker can get a victim to import or sync them, or if the attacker controls the source account.

The defences are contextual output encoding (HTML-entity encoding for text, attribute encoding inside attributes, JavaScript encoding inside scripts), a strict Content Security Policy that blocks inline handlers such as onerror, and treating all synced or imported data as untrusted input.

How to test for it

  1. Map every feature that imports or syncs data from a third party: contacts, calendars, files, profiles, address books.
  2. Put a harmless marker payload in each field of the source record, for example a name containing angle brackets and a quoted attribute break, and sync it into the target.
  3. Visit every page where that data is displayed, including secondary views such as invite dialogs, export previews and search results.
  4. Trigger the actions that render the field, such as clicking invite, share or send, and watch for the marker executing.
  5. If the field is reflected into an attribute, try breaking out of the attribute; if it lands in a URL or script block, adjust the payload for that context.

A positive result is your marker running as script in the target origin. Common false positives are payloads that appear encoded in the response but are decoded by a client-side framework, payloads that only execute in your own browser because of an extension, and reflected values that are safely placed in a text node but look dangerous in the raw HTML. Always confirm execution in a clean browser profile and check the exact context in the response.

How it is fixed

Encode all imported data for the context where it is rendered, using the framework's escaping by default and explicit encoding where HTML is built by hand. Avoid inserting user data into inline event handlers or href/src attributes without validation. Add a Content Security Policy that disallows inline script and inline event handlers. Where possible, validate or sanitise imported fields on ingestion, and re-test the invite and share flows after the fix.

Hunting notes

This bug class hides in integration surfaces: OAuth-connected accounts, CSV imports, contact and calendar sync, and any place where a third party supplies a display name. Recon signals include endpoints with words like browse, contacts, invite, import and sync, and features that show data the user did not type into the target directly. To make a report land, show the exact source of the payload, the exact page and action that renders it, and a minimal proof such as a popup; if you can, demonstrate a concrete consequence rather than only prompt(1), and state clearly which user interaction is required.

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

One of its features let a user connect their Openfolio account to Google Contacts, so the names and email addresses already stored in Google could be pulled into Openfolio. From that imported list, the user could then invite people to Openfolio.

A security researcher (someone who looks for flaws in websites so they can be fixed) found that this invite feature could be made to run code in a visitor's browser. The trick was to put a small piece of code into a contact's name in Google, sync that contact into Openfolio, and then click the invite button next to it. The code ran, and a popup box appeared on the page.

That popup is the proof. It shows the browser treated the contact name as part of the page's code rather than as plain text. A popup is harmless by itself, but the same trick could be used to run any code the attacker wanted, in the context of the Openfolio website, inside the browser of whoever triggered it.

It does not give a severity rating or a CVSS score, and it does not describe how the problem was fixed.

The steps, one by one

  1. The researcher created a new contact in Google Contacts, using the Google Contacts page:
Text
https://www.google.com/contacts/u/0/#contact/new
  1. As the contact's name he typed a short piece of HTML, and gave the contact a random email address:
Text
"><img src=x onerror=prompt(1)>

Let us take that payload apart, because every character has a job:

  • " closes an attribute that the page had already opened. Imagine a label on a box that says name=" and then expects a value; this quote ends that value early.
  • > closes the HTML tag that was still open, so whatever follows is treated as a brand new element.
  • <img src=x ...> starts an image element. src=x points at an address that does not exist, so the image will fail to load. That failure is the point.
  • onerror=prompt(1) is an event handler: a piece of code the browser runs when something goes wrong. Here it runs when the image fails to load. prompt(1) opens a small popup box showing the number 1.

So the whole string is designed to break out of the place where the name was supposed to sit and add a new element that runs code on its own.

  1. He synced Openfolio with Google Contacts, so the contact with the strange name was copied into Openfolio.

  2. He opened the contacts page in Openfolio:

Text
https://openfolio.com/browse/contacts/
  1. He clicked the invite control next to the contact named "><img src=x onerror=prompt(1)>. The popup appeared.

Why does each step matter? The first two steps show where the bad data comes from: an ordinary Google contact, which anyone can create. The sync step shows how that data travels into Openfolio without the user typing it there. The last step shows where it comes out again: the invite page. The popup appeared after the invite control was clicked.

Why this is a real problem

A popup proves that code ran, but it does not show what an attacker would do with it. The report only demonstrates the popup. Still, code running inside the Openfolio website could, in principle, act as the logged-in user. That is why this class of bug is taken seriously even when the proof looks trivial.

In general, how this kind of bug works

This is called cross-site scripting, usually shortened to XSS. The idea is simple: a website takes some data and puts it into a page, and the browser cannot tell whether that data is ordinary text or instructions. If the data contains characters that mean something in HTML, such as <, > or ", the browser may treat them as markup and run whatever is inside.

A useful comparison is a form letter. If you fill in a blank with your name, the letter reads normally. If you fill it in with a sentence that says "ignore the rest of this letter and do something else", a careful reader notices, but a machine that just pastes the text in does not. The contact name ended up in the page in a way that let the browser run it as code.

There are two main flavours:

  • Reflected XSS: the bad data comes back in the same response, usually from a link the victim clicks.
  • Stored XSS: the bad data is saved somewhere, such as a database or a synced contact, and shown later to anyone who views the page. The name was saved in the synced contact and rendered when the invite control was used.

Data that arrives from another service is a common source of this problem, because developers often assume it is clean. Contact names, calendar titles, file names and profile display names can all be influenced by an attacker if they can get the victim to import or sync them, or if they control the account the data comes from.

The usual defences are:

  • Output encoding: converting characters like < into safe forms such as &lt; before putting them in a page, so the browser shows them as text instead of running them.
  • A Content Security Policy: a set of rules a site sends to the browser saying which scripts are allowed. A strict policy can block inline handlers such as onerror.
  • Treating imported data as untrusted: validating or cleaning fields when they arrive, not only when they are displayed.

How to test for it yourself

  1. List every feature that brings data in from another service: contacts, calendars, files, profiles.
  2. Put a harmless marker in a field of the source record, for example a name containing angle brackets and a quote, and sync it into the target site.
  3. Visit every page where that data appears, including secondary views such as invite dialogs, export previews and search results.
  4. Trigger the actions that display the field, such as clicking invite, share or send, and watch whether the marker runs.
  5. If the field lands inside an attribute, try breaking out of the attribute; if it lands in a URL or a script block, adjust the payload for that place.

A positive result is your marker running as code on the target site. Watch out for false positives: a value that looks dangerous in the raw page source may be safely encoded, a payload may only run because of a browser extension you have installed, and some values are decoded later by client-side code. Confirm in a clean browser profile and check exactly where in the page the value ends up.

How it is fixed

Encode all imported data for the place where it is shown, using the framework's escaping by default and explicit encoding where HTML is built by hand. Avoid putting user data into inline event handlers or into href and src attributes without validation. Add a Content Security Policy that disallows inline script and inline event handlers. Where possible, validate or clean imported fields when they are received, and re-test the invite and share flows after the fix.

Where to look when hunting

This kind of bug hides in integration surfaces: accounts connected through OAuth (a way for one site to access another on your behalf), CSV imports, contact and calendar sync, and anywhere a third party supplies a display name. Useful signals are pages with words like browse, contacts, invite, import and sync, and features that show data the user did not type into the target site directly. To make a report convincing, show where the payload came from, which page and action displayed it, and a minimal proof such as a popup. If you can, show a concrete consequence rather than only prompt(1), and state clearly which user interaction is required.

Glossary

  • XSS (cross-site scripting): a flaw where a website puts untrusted data into a page in a way that lets the browser run it as code.
  • Stored XSS: XSS where the bad data is saved and shown later to whoever views the page.
  • Reflected XSS: XSS where the bad data comes back in the same response, usually via a crafted link.
  • Payload: the piece of text or code an attacker inserts to trigger a flaw.
  • HTML: the language that describes the structure of a web page, using tags such as <img>.
  • Tag: a piece of HTML such as <img>, which tells the browser to create an element.
  • Attribute: a setting inside a tag, such as src or onerror, written as name=value.
  • Event handler: code attached to an element that runs when something happens, such as an image failing to load.
  • prompt(1): a browser function that opens a popup box showing a value; commonly used as harmless proof that code ran.
  • Output encoding: converting special characters into safe forms so the browser displays them as text rather than running them.
  • Content Security Policy (CSP): rules a site sends to the browser saying which scripts may run.
  • OAuth: a way for one website to access data from another service on a user's behalf, without sharing the password.
  • Sync: copying data between two services so both hold the same records.
  • Origin: the combination of scheme, host and port that identifies a website; code running in one origin can act within it.
  • Session: the logged-in state a website keeps for a user, usually tied to a cookie.
  • Cookie: a small piece of data a site stores in the browser to remember who you are.
  • CVSS: a standard scoring system for rating the severity of a security flaw.
  • Bounty: a reward paid to a researcher for reporting a valid security flaw.
  • False positive: a result that looks like a flaw but is not one.

More by defmax

View all

7 more disclosed reports, best first.

More from Openfolio

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.