Practical Example Of Client Side Path Manipulation
The invite link's inviteCode parameter was used to build a backend POST request URL without sanitisation, allowing path traversal to redirect the request to other endpoints. An attacker could craft a link that, when clicked by an authenticated admin, sent a POST request to cancel a bank card or potentially whitelist an email as super-admin.
Published on erasec.be
A few months ago, I stumbled onto an interesting case of Client-Side Path Manipulation in a private bug bounty program. Since I wanted to start a blog, and I noticed that another client side path traversal was mentioned in PortSwigger’s Top 10 web hacking techniques of 2022, I thought it would be a good first article.
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
Impact
An attacker could perform actions on behalf of an authenticated admin user, such as cancelling a bank card, and potentially escalate privileges to super-admin by targeting a whitelisting endpoint.
What the attacker needed
Victim is an authenticated admin; victim clicks a crafted link; attacker knows a target endpoint
How it was found
- The attacker modifies the inviteCode parameter in the invite link to include a path traversal sequence and a target endpoint path.
- The attacker adds a query parameter to the inviteCode to prevent the original /check suffix from being appended.
- The attacker sends the crafted link to an authenticated admin user.
- The admin clicks the link, and the application's JavaScript sends a POST request to the backend with the modified URL, including the CSRF token and session cookies.
- The backend processes the request as the admin, performing the action (e.g., cancelling a bank card).
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.
When you click an invite link, the website's JavaScript reads the invite code from the URL and uses it to build a request to the server. The site did not check that the code was safe, so an attacker could put path traversal characters in it to make the request go to a different server endpoint. This let an attacker perform actions as the victim, like cancelling a card, just by getting them to click a link.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.