{"id":"CVE-2022-24712","aliases":["BIT-codeigniter-2022-24712","GHSA-4v37-24gm-h554"],"url":"https://o3.security/vulnerability/CVE-2022-24712","summary":"Cross-Site Request Forgery (CSRF) Protection Bypass Vulnerability in CodeIgniter4","details":"### Impact\nThis vulnerability might allow remote attackers to bypass the CodeIgniter4 CSRF protection mechanism. \n\n### Patches\nUpgrade to v4.1.9 or later.\n\n### Workarounds\nThese are workarounds for this vulnerability, but **you will still need to code as these after upgrading to v4.1.9**.\nOtherwise, the CSRF protection may be bypassed.\n\n#### When Auto-Routing is Enabled\n1. Check the request method in the controller method before processing.\n\nE.g.:\n```php\n        if (strtolower($this->request->getMethod()) !== 'post') {\n            return $this->response->setStatusCode(405)->setBody('Method Not Allowed');\n        }\n```\n\n#### When Auto-Routing is Disabled\nDo one of the following:\n1. Do not use `$routes->add()`, and [use HTTP verbs in routes](https://codeigniter4.github.io/userguide/incoming/routing.html#using-http-verbs-in-routes).\n2. Check the request method in the controller method before processing.\n\nE.g.:\n```php\n        if (strtolower($this->request->getMethod()) !== 'post') {\n            return $this->response->setStatusCode(405)->setBody('Method Not Allowed');\n        }\n```\n\n### References\n- [CodeIgniter4 CSRF protection](https://codeigniter4.github.io/userguide/libraries/security.html#cross-site-request-forgery-csrf)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [codeigniter4/CodeIgniter4](https://github.com/codeigniter4/CodeIgniter4/issues)\n* Email us at [SECURITY.md](https://github.com/codeigniter4/CodeIgniter4/blob/develop/SECURITY.md)\n","published":"2022-02-28T16:00:12Z","modified":"2026-08-12T03:51:44.318728410Z","cvss":{"score":6.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:L"},"epss":{"score":0.00565,"percentile":0.4438,"asOf":"2026-08-23"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"codeigniter4/framework","fixedVersion":"4.1.9"}],"fix":null,"references":[{"type":"WEB","url":"https://github.com/codeigniter4/CodeIgniter4/blob/7dc2ece32401ebde67122f7d2460efcaee7c352e/user_guide_src/source/changelogs/v4.1.9.rst"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24712.json"},{"type":"ADVISORY","url":"https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-4v37-24gm-h554"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24712"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:44.318728410Z"}}