GHSA-4V37-24GM-H554
Vulnerability from github – Published: 2022-03-01 21:47 – Updated: 2022-03-01 21:47Impact
This vulnerability might allow remote attackers to bypass the CodeIgniter4 CSRF protection mechanism.
Patches
Upgrade to v4.1.9 or later.
Workarounds
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.
When Auto-Routing is Enabled
- 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');
}
When Auto-Routing is Disabled
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');
}
References
For more information
If you have any questions or comments about this advisory: * Open an issue in codeigniter4/CodeIgniter4 * Email us at SECURITY.md
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "codeigniter4/framework"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.1.9"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-24712"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": true,
"github_reviewed_at": "2022-03-01T21:47:28Z",
"nvd_published_at": "2022-02-28T16:15:00Z",
"severity": "MODERATE"
},
"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-\u003erequest-\u003egetMethod()) !== \u0027post\u0027) {\n return $this-\u003eresponse-\u003esetStatusCode(405)-\u003esetBody(\u0027Method Not Allowed\u0027);\n }\n```\n\n#### When Auto-Routing is Disabled\nDo one of the following:\n1. Do not use `$routes-\u003eadd()`, 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-\u003erequest-\u003egetMethod()) !== \u0027post\u0027) {\n return $this-\u003eresponse-\u003esetStatusCode(405)-\u003esetBody(\u0027Method Not Allowed\u0027);\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",
"id": "GHSA-4v37-24gm-h554",
"modified": "2022-03-01T21:47:28Z",
"published": "2022-03-01T21:47:28Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-4v37-24gm-h554"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-24712"
},
{
"type": "WEB",
"url": "https://github.com/codeigniter4/CodeIgniter4/blob/7dc2ece32401ebde67122f7d2460efcaee7c352e/user_guide_src/source/changelogs/v4.1.9.rst"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:L",
"type": "CVSS_V3"
}
],
"summary": "Cross-Site Request Forgery (CSRF) Protection Bypass Vulnerability in CodeIgniter4"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.