HR Admin Account Takeover: Chaining Stored XSS and IDOR in a Huma
A travel expense description field stored an XSS payload that executed when an admin viewed the request. An IDOR in the admin edit endpoint allowed viewing other organisations' travel requests, so the stored XSS could be used to take over other organisations' admin accounts.
Recently, I was testing B2B Human Resource web application https://example.redacted.com with roles; “Admin” and “Employee”.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the description field was stored and rendered without output encoding, and the travel request edit endpoint used a predictable numeric identifier without checking the requesting admin's organisation.
Impact
An employee could execute code in their own organisation's admin browser, and because of the IDOR an attacker could potentially take over other organisations' admin accounts by sending a stored XSS travel request that those admins would view.
What the attacker needed
Employee account in the HR app; admin views the travel request; admin edits a travel request by ID
How it was found
- As an employee, submit a travel expense with a cross-site scripting payload in the description field.
- As an admin, open the travel expense approval page and observe that the payload executes.
- As an admin, open the edit page for a travel request and change the numeric identifier to another organisation's request.
- Observe that another organisation's employee travel request is displayed.
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 write-up has not been written yet. The Original tab links to the source.
This report describes two security mistakes in a human resources web app. First, the app saved whatever text an employee typed into a travel expense description and later showed it to an admin without cleaning it, so malicious code could run in the admin's browser. Second, the app used a simple number in the web address to identify each travel request, and it did not check that the admin belonged to the same organisation, so one organisation's admin could open another organisation's requests.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.