A unique XSS scenario 1000 Bounty
A stored cross-site scripting vulnerability existed in Smartsheet's notification system, where a malicious link name containing an image tag with an onerror handler executed JavaScript when a user clicked the notification. An attacker could exploit this to take over any user's account, including those with higher privileges.
Published on medium.com
{{media:0}}
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.
Context
Smartsheet is a spreadsheet-like collaboration product: a user creates a sheet, grants other users access to it, and everyone with access can work on the same document. The feature that matters here is notifications. Whenever one user changes a document, the other users of that sheet can be notified about the change. In this case the change was the addition of an attachment, specifically a link attachment, and the notification is what the recipient clicks to see what happened.
The bug is a stored cross-site scripting issue in that notification flow. The payload is stored as the name of a link attachment, and the JavaScript runs when a user clicks the notification about that attachment. The author describes it as a stored XSS whose trigger is a click on a notification, and notes that this could let an attacker take over an account with either vertical or horizontal privilege differences, which is what raised the severity.

Setup
The researcher signed up for a normal account on the platform and explored what a normal user can do. Two roles are used throughout the write-up:
tester, the account that owns or can edit the sheet and creates the malicious attachment.victim1, another user who has been given access to the sheet and therefore receives notifications about changes to it.
The researcher enabled notifications before attaching the link, and the notification about the attachment is what the victim clicks. The researcher explicitly enabled notifications before attaching the link.
No specific browser, version or tooling is named in the report. The researcher mentions a full-port nmap scan started during recon and fuzzing of the API running in the background, but neither produced the finding; the bug was found by manually going through requests and responses in a proxy with many repeater tabs open.
Finding it
After the initial recon and a few hours of testing IDOR, SQL injection and XSS without success, the researcher turned to SSRF and noticed that links can be attached through the attachment feature. The idea was to attach a link and put a payload into the link name parameter, the field that holds the display name of the attachment.
The first attempt used this payload in the link name parameter, with the link itself pointing at scanme.nmap.org:22:
"><img src=x onerror="alert(1)">
This time notifications were enabled, and the link was attached to the document. A notification appeared after about a minute. Clicking it showed that the HTML content rendered after clicking the notification was slightly misplaced because of the payload, which indicated the name was being placed into markup. Looking at the markup near the link name parameter, the researcher modified the payload to:
">"><img src=x onerror="alert(1)">

Exploitation
Step 1: attach a link with a payload as its name
With notifications enabled, the tester account attaches a link to the sheet and sets the link name to the doubled payload above. The link target itself is not what carries the attack; the name is.
Step 2: wait for the notification
Nothing happens on the sheet itself after the attachment is added. After a few minutes the notification that an attachment has been added to the document arrives.

Step 3: click the notification
When the notification is clicked, the stored payload executes.

The important property is that the script does not run when the attachment is created or when the sheet is viewed. It runs in the session of whoever clicks the notification, which is exactly the other user of the sheet, not the attacker.
Root cause
The link name supplied by the user is stored and later rendered into the HTML of the notification without being correctly encoded for the context it lands in. The first payload made the HTML content after clicking the notification slightly misplaced, and the doubled payload then executed when the notification was clicked. The report does not show the server-side code, so the exact escaping routine that failed is not stated; likely the name was escaped for one context and then reused in another, or escaped only partially.
That is also why nothing happened on the sheet and the researcher initially thought the attempt had failed.
Impact
Any user who can add an attachment to a sheet shared with someone else can store the payload, and any user who clicks the resulting notification runs the attacker's JavaScript in their own session. The researcher frames this as account takeover: if the true owner of the page clicks the malicious notification, their account is compromised. The researcher describes the bug as allowing takeover of any account, with vertical and horizontal privileges, which raised the severity. The attack depends on the victim clicking the notification; it does not fire on its own.
Fix
The report does not describe the fix that was applied. The status was changed to Resolved on 16 October 2018, and the researcher agreed to coordinated disclosure the same day.
Variants to test
- Other notification types. Any event that produces a notification with a user-controlled string in it (comment added, row updated, sheet shared) is worth the same treatment. A positive result is the payload executing when the notification is clicked, not when the change is made.
- Other name fields on attachments and links. File names, link descriptions and similar labels often share the same rendering path. A positive result is the markup around the value changing shape when a quote is supplied, followed by execution with the corrected number of closing quotes.
- Context probing with a harmless marker. Insert a single
"and inspect the rendered notification markup to see which context the value lands in before trying a full payload. A positive result is visibly broken markup that tells you how many characters are needed to escape. - Delayed rendering paths. Where a value is stored and shown later in email, digest or in-app notification views, test each view separately, since one may encode correctly and another not. A positive result is execution in the delayed view while the main application view stays clean.
Timeline
The report was submitted on Bugcrowd on 3 October 2018 at 19:21:24 UTC. More information was requested on 5 October 2018 and provided on 6 October 2018. The report was triaged on 10 October 2018, and 20 points and a $1000 bounty were awarded on 12 October 2018, the same day disclosure was requested. The status changed to Resolved and coordinated disclosure was agreed on 16 October 2018. The write-up was published on 3 February 2019.
What happened, in plain words
Smartsheet is a website where people work on spreadsheets together, a bit like a shared Google Sheet or an online version of Microsoft Excel. One person creates a sheet, gives other people permission to open and edit it, and everyone with access works on the same document. The feature at the centre of this story is notifications: when one person changes a document, the other people who share it can be told about the change. In this case the change was that an attachment was added, and the notification is the little message the recipient clicks to go and see what happened.
The researcher found a bug in that notification flow. An attachment can be a link, and a link has a display name, the text shown for it. That name is typed in by the user, and the site saved it and later showed it inside the notification without handling it safely. The researcher put a small piece of JavaScript, the programming language that web pages run in your browser, into the link name. Nothing happened when the attachment was created and nothing happened when the sheet was viewed. The script only ran when somebody clicked the notification about the attachment. That is the whole trick: the dangerous text sits quietly on the server until the notification is opened, and then it runs in the browser of whoever opened it.
Because the notification goes to everyone who shares the sheet, the person who clicks it does not have to be the person who planted it. The researcher describes this as account takeover: if the real owner of the page clicks the malicious notification, their account is compromised. The report says this works across both vertical and horizontal privilege differences, meaning it is not limited to people who have the same level of access as the attacker. The one condition is that the victim clicks the notification; it does not fire by itself.

The setup
The researcher signed up for a normal account on the platform and spent time finding out what an ordinary user can do. Two roles appear throughout the write-up:
tester, the account that owns or can edit the sheet and creates the malicious attachment.victim1, another user who has been given access to the sheet and therefore receives notifications about changes to it.
The researcher enabled notifications before attaching the link, and the notification about the attachment is what the victim clicks. The researcher explicitly enabled notifications before attaching the link.
The report does not name a specific browser, version or tool. The researcher mentions starting a full-port nmap scan during recon and running some fuzzing against the API in the background, but neither of those produced the finding. The bug was found by manually going through requests and responses in a proxy, with many repeater tabs open.
Finding it
After the initial recon and a few hours of trying IDOR, SQL injection and XSS without success, the researcher turned to SSRF and noticed that links can be attached through the attachment feature. The plan was to attach a link and put a payload into the link name parameter, the field that holds the display name of the attachment.
The first attempt used this payload in the link name parameter, with the link itself pointing at scanme.nmap.org:22:
"><img src=x onerror="alert(1)">
Here is what each part does. The leading "> is a double quote followed by a greater-than sign. In HTML, the language web pages are written in, a double quote usually closes an attribute value, and > usually closes a tag. Sending both is an attempt to end whatever piece of markup the name has been dropped into and get back out into the open page. Then <img src=x onerror="alert(1)"> asks the browser to show an image. src=x points at a file called x that does not exist, so the image fails to load. onerror is an attribute that tells the browser what to do when loading fails, and here it is set to alert(1), which makes the browser pop up a small box with the number 1 in it. The pop-up is harmless; it is just proof that the browser ran the code. A real attacker would put something more useful in that place.
This time notifications were enabled, and the link was attached to the document. A notification appeared after about a minute. Clicking it showed that the HTML content rendered after clicking the notification was slightly misplaced because of the payload, which indicated the name was being placed into markup. Looking at the markup near the link name parameter, the researcher modified the payload to:
">"><img src=x onerror="alert(1)">
The only difference is the doubled ">" at the start. The first attempt made the HTML content after clicking the notification slightly misplaced, and the doubled payload then executed when the notification was clicked. Adding the second pair of characters closed that context, and the image tag that followed was then read as markup rather than as text.

Exploitation
Step 1: attach a link with a payload as its name
With notifications enabled, the tester account attaches a link to the sheet and sets the link name to the doubled payload above. The link target itself is not what carries the attack; the name is. This matters because it shows the problem is not in where the link points but in the text used to label it.
Step 2: wait for the notification
Nothing happens on the sheet itself after the attachment is added. After a few minutes the notification that an attachment has been added to the document arrives.

Step 3: click the notification
When the notification is clicked, the stored payload executes.

The important property is that the script does not run when the attachment is created or when the sheet is viewed. It runs in the session of whoever clicks the notification, which is exactly the other user of the sheet, not the attacker. A session is the browser's way of staying logged in: after you sign in, the site gives your browser a small piece of data, often called a cookie or a token, and the browser sends it back with every request so the site knows who you are. Code running inside someone's session can act as that person, which is why this kind of bug is serious.
Root cause
The link name supplied by the user is stored and later rendered into the HTML of the notification without being correctly encoded for the context it lands in. Encoding means turning characters that have a special meaning in HTML, such as <, > and ", into harmless stand-ins so the browser shows them as text instead of treating them as instructions. The first payload broke the markup but did not execute, which shows the value was being inserted into an attribute or similar context that needed an extra closing quote; the doubled payload closed that context and then injected an img element whose onerror handler runs the script. The report does not show the server-side code, so the exact escaping routine that failed is not stated; likely the name was escaped for one context and then reused in another, or escaped only partially.
That is also why nothing happened on the sheet and the researcher initially thought the attempt had failed.
Impact
Any user who can add an attachment to a sheet shared with someone else can store the payload, and any user who clicks the resulting notification runs the attacker's JavaScript in their own session. The researcher frames this as account takeover: if the true owner of the page clicks the malicious notification, their account is compromised. The researcher describes the bug as allowing takeover of any account, with vertical and horizontal privileges, which raised the severity. The attack depends on the victim clicking the notification; it does not fire on its own.
Fix
The status was changed to Resolved on 16 October 2018, and the researcher agreed to coordinated disclosure the same day.
Variants to test
- Other notification types. Any event that produces a notification with a user-controlled string in it (comment added, row updated, sheet shared) is worth the same treatment. A positive result is the payload executing when the notification is clicked, not when the change is made.
- Other name fields on attachments and links. File names, link descriptions and similar labels often share the same rendering path. A positive result is the markup around the value changing shape when a quote is supplied, followed by execution with the corrected number of closing quotes.
- Context probing with a harmless marker. Insert a single
"and inspect the rendered notification markup to see which context the value lands in before trying a full payload. A positive result is visibly broken markup that tells you how many characters are needed to escape. - Delayed rendering paths. Where a value is stored and shown later in email, digest or in-app notification views, test each view separately, since one may encode correctly and another not. A positive result is execution in the delayed view while the main application view stays clean.
Timeline
The report was submitted on Bugcrowd on 3 October 2018 at 19:21:24 UTC. More information was requested on 5 October 2018 and provided on 6 October 2018. The report was triaged on 10 October 2018, and 20 points and a $1000 bounty were awarded on 12 October 2018, the same day disclosure was requested. The status changed to Resolved and coordinated disclosure was agreed on 16 October 2018. The write-up was published on 3 February 2019.
Glossary
- API: the set of addresses a website offers so that programs, rather than people clicking buttons, can read and change data. Think of it as the service counter behind the shop front.
- Attachment: a file or a link added to a document so it sits alongside the content.
- Attribute: a setting written inside an HTML tag, such as
srcoronerror, that tells the browser something about the element. - Browser: the program you use to open web pages, such as Chrome or Firefox.
- Bug bounty: a programme where a company pays people for reporting security problems to it instead of exploiting them.
- Bugcrowd: a platform where companies list such programmes and researchers submit reports.
- Context (in HTML): the exact place a value is inserted, for example inside an attribute or between tags. The same characters can be harmless in one context and dangerous in another.
- Cookie: a small piece of data a site stores in your browser so it can recognise you on later requests.
- Coordinated disclosure: an agreement between the researcher and the company about when and how the details of a bug may be made public.
- Cross-site scripting (XSS): a bug where an attacker gets their own code to run inside another person's browser session on a site.
- Stored XSS: an XSS where the malicious text is saved on the server and served to other people later, rather than being reflected back immediately.
- CTF: a capture-the-flag competition, a game where people practise finding and exploiting security bugs in prepared challenges.
- Encoding / escaping: converting characters that have a special meaning in HTML into harmless stand-ins so they are displayed as text.
- Fuzzing: sending large numbers of varied or malformed inputs automatically to see whether anything breaks.
- Hack The Box: a website offering practice machines for learning security skills.
- Horizontal privilege: two accounts with the same level of access, for example two ordinary users.
- HTML: the language web pages are written in, made of tags such as
<img>that the browser turns into what you see. - IDOR: a bug where changing an identifier in a request lets you reach another user's data that you should not see.
- JavaScript: the programming language that runs inside web pages and can make them interactive.
- Link name parameter: the field that holds the display name of an attached link.
- Markup: the tags and attributes that make up an HTML page.
- Nmap: a tool that scans a server to see which network ports are open and what services are running.
- Notification: a message the site shows a user to tell them something changed in a document they share.
- OSCP: a well-known practical certification for security testers.
- Payload: the piece of text or code an attacker sends in the hope that it is treated as instructions.
- Port scan: probing a server's numbered network doors to see which are open.
- Privilege: the level of access an account has, for example read-only or full control.
- Proxy: a tool that sits between your browser and the site so you can read and edit every request and response.
- Repeater tab: a pane in a proxy tool that lets you resend the same request over and over with small changes.
- Recon: short for reconnaissance, the early stage of gathering information about a target.
- Render: what the browser does when it turns HTML into the page you see.
- Request and response: the message your browser sends to a server, and the message the server sends back.
- Session: the period during which a site remembers that you are logged in, usually tracked with a cookie or token.
- SSRF: a bug where the server can be made to send requests to addresses of the attacker's choosing.
- Tag: an HTML instruction such as
<img>that tells the browser to place something on the page. - Token: a piece of data, similar to a cookie, that proves to the server who you are.
- Triaged: the stage at which a programme has reviewed a report and accepted that it describes a real issue.
- Vertical privilege: two accounts with different levels of access, for example an administrator and an ordinary user.
- WordPress plugin: an add-on for the WordPress publishing software, often written by third parties.