APIs for channels allow HTML entities that may cause XSS issue
The channel API accepted HTML and script markup in a channel's name and description, and some pages built a channel select box without encoding that content. An attacker could get script to run in a victim's browser on Vimeo pages, though the report notes exploitation is difficult.
- Triaged in 2 hours
- Fixed in 3 hours
- Paid in 7 days
- Disclosed after 2 days
Hello,
I found Vimeo's bug bounty program on [1]. Please find below details of a security issue I found.
First, APIs for channels [2] allow you to put HTML and javascript to name or description of a channel. For example, an attacker can use a Python script like the following to put javascript to an existing channel:
import httplib, urllib server = "api.vimeo.com" endpoint = "/channels/855545" params = urllib.urlencode({'name': 'my channel<script>alert(document.cookie)</script>', 'description': 'bug bounty', 'privacy': 'anybody'}) headers = {"Authorization": "Bearer [token]", "Content-Type": "application/x-www-form-urlencoded"} conn = httplib.HTTPSConnection(server) conn.request("PATCH", endpoint, params, headers) resp = conn.getresponse() print resp.status, resp.reason data = resp.read() print data conn.close()
I created a channel that contains javascript in description:
https://vimeo.com/channels/855545
Second, most of Vimeo's pages cut or encode HTML entities before they are printed out. For example, the page above doesn't execute the injected code. But I found at least two pages that don't encode HTML entities:
https://vimeo.com/album/create https://vimeo.com/channels/<channel_id>/settings/videos
When you create an album you can add videos to this album ("Add videos to this Album" select box on the page above). The select box contains channels you subscribed to or moderate. The page doesn't encode HTML entities when it builds the select box, so the code I injected to name of my channel is successfully executed on this page.
Technically this is a stored XSS vulnerability that allows to inject a javascript code on Vimeo's page. But it might be hard to exploit because an attacker needs to do the following:
- make a victim subscribe to a malicious channel, or modify an existing channel a vicim has subscribed to
- make a victim to open https://vimeo.com/album/create page
Both steps might be not so easy to do, but they are still possible.
I found some other APIs that allow to put HTML entities, but I have not checked all APIs. The problem may be fixed by making APIs encode or cut HTML entities, but it may probably cause some compatibility issues. Another way is to encode or cut HTML entities before channel name is printed out on the page above. This way, other Vimeo's pages need to be checked.
[1] https://bugcrowd.com/list-of-bug-bounty-programs [2] https://developer.vimeo.com/api/endpoints/channels#/{channel_id}
Artem
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the channel API stored raw HTML in the name and description, and the album and settings pages built their select boxes without encoding that stored content.
Impact
Script could run in a victim's browser, but exploitation is hard because the attacker must get the victim to subscribe to or moderate the malicious channel and then open the album creation page.
What the attacker needed
Victim subscribes to or moderates the channel; victim opens the album creation page
The fix
The API should encode or strip HTML entities, or the pages should encode channel names before printing them, though the report notes compatibility concerns and that other pages would need checking.
How it was found
- Send a request to the channel API to set a channel name containing script markup.
- Open the album creation page, which lists subscribed or moderated channels in a select box.
- Observe that the injected script runs because the select box is built without encoding.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A website should treat anything a user types as plain text, not as code. Here, a channel name could contain a script tag, and one page inserted that name into the page without cleaning it, so the browser ran the script. This is called stored cross-site scripting because the malicious text is saved on the server and shown to other people later.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.