CSRF in ticket function
The TikTok Shop ticket creation endpoint did not enforce CSRF protection when the request was sent as form-encoded data instead of JSON, allowing an attacker to forge a request that creates a ticket on behalf of a victim. An attacker could trick a logged-in user into submitting a malicious form, resulting in arbitrary ticket creation.
Originally disclosed on HackerOne
- Triaged in 4 days
- Fixed in 40 days
- Paid in 6 days
- Disclosed after 20 months
Summary by the program
A cross-site request forgery (CSRF) vulnerability was found on a TikTok Shop endpoint, which could have resulted in the arbitrary creation of tickets. We thank @ibrahim0936356 for reporting this to our team
Summary by the researcher
Hi there!
I found this issue by removing the CsrfToken from the header and converting the content type from JSON to x-www-form-urlencoded. After multiple attempts, I was able to create the final payload:
<form method="POST" action="https://vulnerableEndpoint">
<input type="hidden" name="category_id" value="X"/>
<input type="hidden" name="title" value="Happy"/>
<input type="hidden" name="componentContents" value='[{"id":"X","raw_value":"very happy"},{"id":"X","raw_value":"[{\"status\":\"done\",\"percent\":XXXX,\"uid\":\"XXXX\",\"originFile\":{},\"name\":\"XXXX\",\"response\":{\"file_id\":\"XXXXXX\",\"file_name\":\"XXXX\",\"file_type\":\"image/png\",\"file_src\":X,\"url\":\"XXXX\"}}]","plain_value":"[\"XXXXXX\"]"}]'/>
</form>
<script>
document.forms[0].submit();
</script>
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 endpoint relied on JSON content type and a CSRF token header for protection, but failed to enforce CSRF protection when the request was sent as form-encoded data.
Impact
An attacker could create arbitrary tickets on behalf of a victim.
What the attacker needed
Victim is logged in; victim visits a malicious page
How it was found
- Remove the CSRF token from the request header.
- Change the content type from JSON to x-www-form-urlencoded.
- Craft an HTML form with the required fields and auto-submit it.
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.
Cross-site request forgery (CSRF) is when a malicious website makes a logged-in user's browser send a request to another site without the user's knowledge. Here, the ticket creation endpoint accepted form submissions without checking a security token, so an attacker could create a form that automatically submits and creates a ticket for the victim.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.