CakePHP <= 3.2.0 "_method" CSRF Protection Bypass Vulnerability
CakePHP only enforces its CSRF and form-tampering checks when the request method is POST or PUT, but the router also lets the method be overridden through a POST parameter and certain headers. An attacker could therefore send a request that skips those security checks.
karmainsecurity.com
Published on karmainsecurity.com
CakePHP provides some built-in security features including CSRF and Form Tampering protection. Under certain circumstances it might be possible to bypass such security checks, since they are performed only when the HTTP request is e.g.
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 security checks were tied to the detected HTTP method, while the method itself could be overridden by client-controlled input, so the checks could be skipped.
Impact
An attacker could bypass CSRF and form-tampering protection, though the text does not demonstrate a working exploit.
What the attacker needed
Attacker can get a victim to send a crafted request
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.
Websites use a secret token to make sure a form submission really came from their own page, which stops other sites from silently acting as you. CakePHP only checks that token for certain request types, but it also lets a request declare a different type through an extra field or header. So a crafted request could avoid the check entirely.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.