Smuggling My Way Past Frontend Filters: A Fun Find on HackerOne
The frontend blocked POST requests to sensitive endpoints with 403, but allowed OPTIONS requests through. The backend honoured an X-Http-Method-Override header, so an attacker could send an OPTIONS request with that header set to POST and have the backend process it as a POST, bypassing the frontend access control.
medium.com
Published on medium.com
You know that feeling when you’re just poking around, kinda half-bored, and stumble onto something juicy? Yeah, that’s pretty much what happened here.
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 frontend and backend disagreed on which HTTP methods were allowed, and the backend trusted a client-supplied method-override header without the frontend filtering it.
Impact
An attacker could bypass frontend access controls to reach endpoints that were supposed to be off-limits, potentially on any endpoint where the frontend blocked methods.
What the attacker needed
A valid JWT for the API; knowledge of a sensitive endpoint
How it was found
- Send a POST request to a sensitive endpoint and observe a 403 Forbidden from the frontend.
- Send an OPTIONS request to the same endpoint with an X-Http-Method-Override header set to POST.
- Observe the backend process the request as a POST, returning a 400 error about a missing field instead of a 403.
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.
A website often has a front door (frontend) that checks what you are allowed to do, and a back room (backend) that does the actual work. Here, the front door said no to a certain type of request (POST), but the back room would still accept it if you sent a different type (OPTIONS) with a special note saying 'treat this as a POST'. That let the person get past the front door's rules.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.