CSRF - Modify Company Info
The company info editing endpoint lacked a CSRF token, allowing an attacker to forge a request that changes a victim's company details. The attacker could host a malicious page and trick an authenticated user into visiting it, causing unauthorised modification of company information.
Originally disclosed on HackerOne
- Triaged in 3 hours
- Fixed in 40 days
- Disclosed after 49 days
Target Url ███/services/user/manageAccountCompany
Summary: Similar to███████, but on different endpoint. The application is missing CSRF Token on Editing company info endpoint. This lead to CSRF attack.
Bypassing Content-Type The application is just accepting Content-Type as application/json. This can be bypassed in several ways. One of the ways is to Forge Content-Type header with flash. You need a flash file capable of sending cross-domain requests and a 307 redirector page. For more info please see: https://blog.cm2.pw/forging-content-type-header-with-flash/
Step-by-step Reproduction Instructions
- Edit your company info and intercept its request.
- Get the HTML code format from burp suite -> Engagement Tools -> Generate CSRF POC.
- Click Test in Browser button, and on another browser/tab accessed by the victim account, paste the link.
- Now hit on the button and intercept its request.
- Modify the request header of Content-Type to: application/json.
- Forward the request and CSRF exploited successfully and the info changed successfully.
Suggested Mitigation/Remediation Actions
Add a csrf-token in the header or in an hidden input to check if the user that is doing this action authorized or not.
Impact
This action is critical and sensitive. Attacker can upload this file to a url. Sends it to the victims. And when the authenticated victims navigate to the url their profile info will be modified.
Regards.
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 did not require a CSRF token or any other anti-CSRF mechanism to validate that the request originated from the application itself.
Impact
An attacker could modify a victim's company information by tricking an authenticated user into visiting a malicious page, which is a critical and sensitive action.
What the attacker needed
Victim is authenticated; victim visits attacker-controlled page
The fix
The endpoint should require a CSRF token, either in a header or a hidden form field, to verify the user's authorisation.
How it was found
- Edit company info and intercept the request.
- Generate a CSRF proof-of-concept from the intercepted request using Burp Suite.
- Open the generated page in a browser and have the victim visit the same link while authenticated.
- Click the button on the page and intercept the resulting request.
- Change the Content-Type header to application/json.
- Forward the request; the company info is changed.
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.
CSRF (Cross-Site Request Forgery) 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 company info editing page did not check for a secret token, so an attacker could craft a request that changes the victim's company details. The attacker just needs the victim to visit a link while logged in.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.