CSRF on https://apps.topcoder.com/wiki/pages/doattachfile.action
The wiki file attachment endpoint lacked a CSRF token, so an attacker could make a signed-in user upload a file without their knowledge by getting them to open a crafted page. The report demonstrates this by creating a file on a specific wiki page.
- Fixed in 9 days
- Disclosed after 7 months
Summary:
Hi :) There is a CSRF on attaching files to wiki pages.
Steps To Reproduce:
There is no CSRF token or anything like that on https://apps.topcoder.com/wiki/pages/doattachfile.action?pageId= . I added the poc html file below. When someone opens this html file, or we can add it into our website, he/she creates an attachment unwillingly.
This file creates csrf.txt on https://apps.topcoder.com/wiki/pages/doattachfile.action?pageId=165871793
Note: This only works to signed-in users. Because unauthorized users cannot upload attachments. There is a mistake on https://apps.topcoder.com/wiki/login.action now. If you encounter an error, you can login on main site (https://accounts.topcoder.com/member) then try.
Impact
An attacker can force other users to upload files without their knowledge.
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
Impact
An attacker could force signed-in users to upload files without their knowledge; the report notes this only works for signed-in users because unauthorised users cannot upload attachments.
What the attacker needed
Victim is signed in; victim opens attacker's page
How it was found
- Create an HTML page that submits a file to the attachment endpoint for a chosen wiki page.
- Get a signed-in user to open that page, or host it on a website the user visits.
- The user's browser sends the request with their session, and the file is attached without their consent.
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.
When you are logged in to a website, your browser automatically sends your session cookie with every request to that site. If a page on another site can make your browser send a request to the first site, the first site may treat it as a legitimate action from you. This is called cross-site request forgery (CSRF). Here, the file-upload action had no extra check to prove the request really came from the site's own pages, so another page could trigger an upload.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.