This vulnerability might allow remote attackers to bypass the CodeIgniter4 CSRF protection mechanism.
Upgrade to v4.1.9 or later.
These are workarounds for this vulnerability, but you will still need to code as these after upgrading to v4.1.9. Otherwise, the CSRF protection may be bypassed.
E.g.:
if (strtolower($this->request->getMethod()) !== 'post') {
return $this->response->setStatusCode(405)->setBody('Method Not Allowed');
}
Do one of the following:
1. Do not use $routes->add()
, and use HTTP verbs in routes.
2. Check the request method in the controller method before processing.
E.g.:
if (strtolower($this->request->getMethod()) !== 'post') {
return $this->response->setStatusCode(405)->setBody('Method Not Allowed');
}
If you have any questions or comments about this advisory: * Open an issue in codeigniter4/CodeIgniter4 * Email us at SECURITY.md
{ "nvd_published_at": "2022-02-28T16:15:00Z", "github_reviewed_at": "2022-03-01T21:47:28Z", "severity": "MODERATE", "github_reviewed": true, "cwe_ids": [ "CWE-352" ] }