[chaturbate.com] - CSRF Vulnerability on image upload
The image upload feature on Chaturbate lacked CSRF tokens, allowing an attacker to upload images to a user's photo set without their consent. The attacker needed to know the photo set ID, which is public, and could then trick the user into submitting a crafted request.
- Triaged in under an hour
- Fixed in 40 hours
- Paid in 18 hours
- Disclosed after 23 days
##Summary##
Hi guys,
One of the features available to a Chaturbate user is the ability to upload images into photo sets. The upload functionality does not use any CSRF tokens, allowing attackers to perform CSRF attacks and upload images to a user's profile without the user's consent.
Steps To Reproduce:
- Login to Chaturbate.
- Browse to your profile page and upload an image.
- Note the
setID of the newly created set (this is available by visiting set in the profile page. It'll be in the URL :https://chaturbate.com/photo_videos/photoset/detail/[username]/[set_id]/). - Download the poc.html file attached to this report.
- Edit
poc.htmlby replacing the number4771110by thesetID found at step #3. - Open poc.html and click on
Submit request. - Visit your Chaturbate image set.
You'll notice that the photo set now inludes an additional image (a blank/white image).
Impact
In order for this attack to work, an attacker would need to know the correct photo set ID. Since set IDs are public information, this isn't an issue.
I've set the impact here to medium since this affects the integrity of user accounts.
Context
Chaturbate lets a user upload images into photo sets on their profile. Each set has its own page, and the set is identified by a numeric ID that appears in the URL when you view it. The upload functionality is the part under examination here: the researcher found that it does not use any CSRF tokens, which means a request to upload an image can be forged from another site and will be accepted on behalf of a logged-in user.
Setup
To reproduce the issue you need:
- A Chaturbate account, logged in.
- The ability to upload an image to your own profile, so that a photo set exists.
- The
poc.htmlfile that the researcher attached to the report. - A way to open that local HTML file in a browser while logged in to Chaturbate.
No special tooling is described beyond a browser and the proof-of-concept page.
Finding it
The image upload feature available to a Chaturbate user was examined. The upload request carried no CSRF token. Because the browser attaches the user's session to any request made to the site, a page on a different origin can submit that upload request and the server has no way to tell it apart from a legitimate one. That is the whole of the observation: the upload endpoint lacks the anti-CSRF protection that would normally be expected on a state-changing action.
Exploitation
The researcher's reproduction is a sequence of manual steps.
Step 1: Log in and create a set
Log in to Chaturbate, browse to your profile page and upload an image. This creates a photo set that the forged request can later target.
Step 2: Note the set ID
The ID of the newly created set is visible when you visit the set from the profile page. It appears in the URL:
https://chaturbate.com/photo_videos/photoset/detail/[username]/[set_id]/
The [set_id] segment is the value the attacker needs.
Step 3: Prepare the proof of concept
Download the poc.html file attached to the report. Edit it, replacing the number 4771110 with the set ID found in step 2. That number is the placeholder the page uses to address the target set.
Step 4: Trigger the forged request
Open poc.html in the browser and click Submit request.
Step 5: Confirm the result
Visit your Chaturbate image set. The photo set now includes an additional image, a blank/white image, The photo set now includes an additional image, a blank/white image..
Root cause
The upload functionality does not use any CSRF tokens. A state-changing request that the server accepts on the strength of the session alone can be issued by any page the victim visits, so the server cannot distinguish the user's own upload from one crafted by a third party. The report does not describe any other defence, such as origin checks, that would have compensated for the missing token.
Impact
An attacker can upload images to a user's profile without the user's consent. The only precondition the researcher identifies is knowledge of the correct photo set ID, and since set IDs are public information this is not an obstacle. The effect is on the integrity of user accounts, which is why the researcher rated the impact medium.
Fix
The report does not describe a fix or say what was changed. The measure implied by the finding is to require a CSRF token on the image upload request, so that a forged submission from another origin is rejected.
Variants to test
- Other upload endpoints on the same site: try submitting an upload from a page on a different origin while logged in. A positive result is a new file appearing in the account without any token being supplied.
- Other state-changing actions in the same feature area, such as creating or editing a set: forge the request from another origin. A positive result is the change taking effect on the victim's account.
- Endpoints that take a public identifier in the URL, as this one does with the set ID: check whether the identifier alone is enough to address another user's object. A positive result is a forged request that modifies an object the attacker only knows by its public ID.
Hunting notes
This kind of bug tends to sit in secondary features rather than the main login and settings flows: uploads, photo sets and similar content management actions that were added later and may not have been given the same protection as the core forms. During recon, look for state-changing requests whose parameters contain no token field, and for object identifiers that appear in public URLs, since those remove the main practical obstacle to a targeted forgery. The researcher demonstrated impact by showing an extra image appearing in the set, and by noting that the set ID is public. That combination, a real state change plus a precondition that is trivially met, is what supports the medium rating.
What happened, in plain words
Chaturbate is a website where users have profiles, and one of the things a user can do is upload images into collections called photo sets. Each photo set lives on its own page, and the address of that page contains a number that identifies the set.
The researcher found that the part of the site that handles image uploads does not check for a special security value called a CSRF token. Without that check, another website can quietly send an upload request to Chaturbate on behalf of someone who is logged in, and Chaturbate will accept it as if the user had done it themselves. The researcher proved this with a small web page, attached to the report, that when opened added a blank white image to the photo set.
This kind of bug is called CSRF, short for Cross-Site Request Forgery. The word "forgery" is the key: the request looks genuine to the server, but the user never meant to send it. A useful everyday comparison is a signed blank cheque. If a bank accepts any cheque that carries your signature without checking whether you actually wrote it, then anyone who gets hold of a signed blank cheque can fill in an amount and cash it. A CSRF token is the bank asking you to also write today's date and a secret word on the cheque, something an outsider cannot guess.
The pieces involved
Before walking through the steps, here are the concepts the report relies on.
- Session and cookie: when you log in to a website, the server gives your browser a small piece of data called a session cookie. Your browser sends that cookie back with every request to the site, which is how the site knows it is still you. You do not see this happen; it is automatic.
- CSRF token: a secret, unpredictable value that a well-protected website puts into forms and requests that change something. The server checks the value before acting. Because another website cannot know or guess the value, it cannot forge a valid request.
- State-changing request: any request that alters data on the server, such as uploading a file, changing a password or posting a comment. These are the requests that need protection.
- Origin: the combination of scheme, host and port that a page comes from, for example
https://chaturbate.com. A page on a different origin is treated as a different place by the browser. - Proof of concept (PoC): a small, deliberately harmless demonstration that a bug is real. Here it is an HTML file that performs the forged upload.
Setting up
To follow the researcher's reproduction you need four things:
- A Chaturbate account, logged in.
- The ability to upload an image to your own profile, so that a photo set exists to target.
- The
poc.htmlfile that the researcher attached to the report. - A way to open that local HTML file in a browser while you are logged in to Chaturbate.
No special tools are needed beyond a browser and the proof-of-concept page. The reason each item matters: the account and the existing set give the forged request something real to act on, and opening the file in the same browser that holds your session is what makes the browser attach your login automatically.
Finding the bug
The researcher was examining the image upload feature available to a Chaturbate user. The upload request carried no CSRF token. Because the browser attaches the user's session to any request made to the site, a page on a different origin can submit that upload request, and the server has no way to tell it apart from a legitimate one.
That is the whole observation: the upload endpoint lacks the anti-CSRF protection you would normally expect on an action that changes data. There is no clever trick in the payload itself; the weakness is the absence of a check.
Reproducing it step by step
Step 1: Log in and create a set
Log in to Chaturbate, browse to your profile page and upload an image. This creates a photo set that the forged request can later target.
Step 2: Note the set ID
The ID of the newly created set is visible when you visit the set from the profile page. It appears in the URL:
https://chaturbate.com/photo_videos/photoset/detail/[username]/[set_id]/
Reading this address from left to right: https://chaturbate.com is the site, photo_videos/photoset/detail/ is the path that leads to a photo set page, [username] is the account name, and [set_id] is the number that identifies this particular set. The [set_id] segment is the value the attacker needs, because it tells the forged request which set to add the image to.
Step 3: Prepare the proof of concept
Download the poc.html file attached to the report. Edit it, replacing the number 4771110 with the set ID found in step 2. That number is a placeholder: the page uses it to address the target set, so leaving it unchanged would point the forged upload at the wrong place.
Step 4: Trigger the forged request
Open poc.html in the browser and click Submit request. This is the moment the missing token matters: the browser adds your session cookie because the request goes to Chaturbate, and the server accepts the upload because nothing else is checked.
Step 5: Confirm the result
Visit your Chaturbate image set. The photo set now includes an additional image, a blank/white image, which is the image the proof of concept uploaded.
Why it works
The upload functionality does not use any CSRF tokens. A request that changes data, and that the server accepts on the strength of the session alone, can be issued by any page the victim visits. The server therefore cannot distinguish the user's own upload from one crafted by a third party. The report does not describe any other defence, such as an origin check, that would have compensated for the missing token.
What an attacker could do
An attacker can upload images to a user's profile without the user's consent. The only precondition the researcher identifies is knowledge of the correct photo set ID, and since set IDs are public information this is not an obstacle. The effect is on the integrity of user accounts, meaning the correctness and trustworthiness of the data in them, which is why the researcher rated the impact medium.
How it should be fixed
The report does not describe a fix or say what was changed. The measure implied by the finding is to require a CSRF token on the image upload request, so that a forged submission from another origin is rejected. In the cheque comparison, this is the bank insisting on the extra secret word before it pays out.
Similar places to look
- Other upload endpoints on the same site: try submitting an upload from a page on a different origin while logged in. A positive result is a new file appearing in the account without any token being supplied.
- Other state-changing actions in the same feature area, such as creating or editing a set: forge the request from another origin. A positive result is the change taking effect on the victim's account.
- Endpoints that take a public identifier in the URL, as this one does with the set ID: check whether the identifier alone is enough to address another user's object. A positive result is a forged request that modifies an object the attacker only knows by its public ID.
Notes for someone hunting this bug
This kind of bug tends to sit in secondary features rather than the main login and settings flows: uploads, photo sets and similar content management actions that were added later and may not have been given the same protection as the core forms. During recon, look for state-changing requests whose parameters contain no token field, and for object identifiers that appear in public URLs, since those remove the main practical obstacle to a targeted forgery. The researcher demonstrated impact by showing an extra image appearing in the set, and by noting that the set ID is public. That combination, a real state change plus a precondition that is trivially met, is what supports the medium rating.
Glossary
- API: a defined way for one piece of software to talk to another, usually over the web, by sending requests to specific addresses and getting structured answers back.
- Cookie: a small piece of data a website stores in your browser and that your browser sends back with each request to that site, often used to keep you logged in.
- CSRF (Cross-Site Request Forgery): an attack where a page on one site causes your browser to send a request to another site where you are logged in, so the request is accepted as if you made it.
- CSRF token: a secret, unpredictable value included in a request and checked by the server, which a different site cannot know or guess.
- Endpoint: a specific address on a server that handles a particular kind of request, such as the one that receives image uploads.
- HTML: the language used to write web pages.
- Integrity: the property that data is correct and has not been changed by someone who should not be able to change it.
- Origin: the scheme, host and port a page comes from, for example
https://chaturbate.com; pages from different origins are kept apart by the browser. - Photo set: a collection of images on a Chaturbate profile, shown on its own page.
- Proof of concept (PoC): a small demonstration that shows a bug is real without causing harm.
- Recon: the information-gathering phase of security testing, where you map out what a site does and how it responds.
- Request: a message your browser sends to a server asking it to do something or return something.
- Session: the period during which a site remembers who you are after you log in, usually tracked with a cookie.
- State-changing request: a request that alters data on the server, such as uploading a file or editing a record.
- URL: the address of a page or resource on the web, such as the photo set address shown above.