VYPR
Moderate severityNVD Advisory· Published Feb 28, 2022· Updated Apr 23, 2025

Cross-Site Request Forgery (CSRF) Protection Bypass Vulnerability in CodeIgniter4

CVE-2022-24712

Description

CodeIgniter4 is the 4.x branch of CodeIgniter, a PHP full-stack web framework. A vulnerability in versions prior to 4.1.9 might allow remote attackers to bypass the CodeIgniter4 Cross-Site Request Forgery (CSRF) protection mechanism. Users should upgrade to version 4.1.9. There are workarounds for this vulnerability, but users will still need to code as these after upgrading to v4.1.9. Otherwise, the CSRF protection may be bypassed. If auto-routing is enabled, check the request method in the controller method before processing. If auto-routing is disabled, either avoid using $routes->add() and instead use HTTP verbs in routes; or check the request method in the controller method before processing.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

CodeIgniter4 versions before 4.1.9 allow remote attackers to bypass CSRF protection, potentially leading to unauthorized actions.

Vulnerability

A vulnerability in CodeIgniter4 versions prior to 4.1.9 allows remote attackers to bypass the Cross-Site Request Forgery (CSRF) protection mechanism. The exact root cause is not detailed, but it affects all configurations using the framework's CSRF protection. Upgrade to version 4.1.9 to fix the issue [1][2][3].

Exploitation

An attacker can exploit this vulnerability by crafting a malicious request that bypasses the CSRF token validation. No authentication is required, as CSRF exploits typically target authenticated sessions. The attack vector is network-based, requiring the victim to visit a malicious page or click a link while authenticated to the target application [2].

Impact

Successful exploitation allows an attacker to perform actions on behalf of an authenticated user without their knowledge, leading to unauthorized state-changing operations such as data modification, deletion, or privilege escalation. The exact impact depends on the application's functionality [1][2].

Mitigation

Users should upgrade to CodeIgniter4 version 4.1.9 or later, released on February 25, 2022 [3]. For those unable to upgrade, workarounds include checking the request method in controller methods (e.g., only accepting POST for sensitive actions) and avoiding $routes->add() in favor of HTTP-verb-specific routes [2]. Note that these workarounds require additional coding even after upgrading to ensure CSRF protection [1][2].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
codeigniter4/frameworkPackagist
< 4.1.94.1.9

Affected products

3

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

4

News mentions

0

No linked articles in our index yet.