CVE-2025-24013 Overview
CVE-2025-24013 affects CodeIgniter, a PHP full-stack web framework, in versions prior to 4.5.8. The framework's Header class lacks proper validation of header names and values, allowing attackers to construct deliberately malformed HTTP headers. These malformed headers can disrupt application functionality, produce errors, or generate invalid HTTP requests downstream. In some deployments, remote web application firewalls may interpret the malformed requests as malicious and block further communication with the application, resulting in a denial of service (DoS) condition. The issue is fixed in CodeIgniter 4.5.8 and is tracked as [CWE-436] Interpretation Conflict.
Critical Impact
Malformed headers crafted through the Header class can trigger invalid HTTP requests and lead to DoS when upstream WAFs block the application.
Affected Products
- CodeIgniter 4 (codeigniter4/CodeIgniter4) versions prior to 4.5.8
- Applications using the CodeIgniter\HTTP\Header class for outbound requests
- Web services fronted by WAFs that block malformed HTTP traffic
Discovery Timeline
- 2025-01-20 - CVE-2025-24013 published to the National Vulnerability Database (NVD)
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-24013
Vulnerability Analysis
The vulnerability resides in the system/HTTP/Header.php component of CodeIgniter 4. The framework accepted header names and values without enforcing the syntactic rules defined in RFC 7230 Section 3.2. RFC 7230 restricts header field names to token characters and prohibits control characters (CR, LF, NUL) in header values.
Because validation was absent, an application using the Header class could construct requests containing illegal characters such as CRLF sequences or non-token bytes in the field name. Downstream HTTP intermediaries, proxies, and WAFs treat such requests as protocol violations or potential smuggling attempts. This leads to inconsistent handling, request rejection, or defensive blocking of the source application.
Root Cause
The Header class did not throw an InvalidArgumentException when supplied with header names or values that violate RFC 7230. The patch introduces validation logic and the InvalidArgumentException import in system/HTTP/Header.php. This categorizes the flaw as an interpretation conflict [CWE-436] between the framework and downstream HTTP consumers.
Attack Vector
The vulnerability is exploitable over the network without authentication or user interaction. An attacker who can influence header inputs passed to the Header class, for example through user-controlled request forwarding or proxy logic, can craft malformed headers. Sustained delivery of malformed requests to a protected upstream endpoint can cause a WAF to blocklist the CodeIgniter application, producing a denial of service.
// Security patch in system/HTTP/Header.php
namespace CodeIgniter\HTTP;
use InvalidArgumentException;
use Stringable;
/**
* Header class now validates name and value against RFC 7230
*/
Source: CodeIgniter4 Commit 5f8aa24
Detection Methods for CVE-2025-24013
Indicators of Compromise
- Outbound HTTP requests from CodeIgniter applications containing CR, LF, or NUL bytes in header names or values
- Sudden spikes in HTTP 400 responses or WAF block events originating from a specific CodeIgniter host
- Application logs referencing the CodeIgniter\HTTP\Header class emitting requests without prior sanitization
Detection Strategies
- Inventory installed CodeIgniter versions across web servers and flag any deployment below 4.5.8
- Inspect HTTP egress traffic for header field names that contain characters outside the RFC 7230 token set
- Correlate upstream WAF block events with the source application to identify malformed-header emitters
Monitoring Recommendations
- Enable request logging on reverse proxies to capture header-level protocol violations
- Alert on repeated 4xx responses from third-party APIs consumed by CodeIgniter applications
- Monitor composer.lock files in CI/CD pipelines to detect vulnerable codeigniter4/framework versions
How to Mitigate CVE-2025-24013
Immediate Actions Required
- Upgrade CodeIgniter 4 to version 4.5.8 or later using composer update codeigniter4/framework
- Audit application code for direct instantiation of CodeIgniter\HTTP\Header with untrusted input
- Add input validation on any user-controlled data that flows into HTTP header construction
Patch Information
The fix is delivered in CodeIgniter 4.5.8 through commit 5f8aa24280fb09947897d6b322bf1f0e038b13b6. The patch adds header name and value validation to system/HTTP/Header.php and raises InvalidArgumentException on non-compliant input. Full details are documented in the CodeIgniter4 Security Advisory GHSA-x5mq-jjr3-vmx6.
Workarounds
- Reject or sanitize header inputs at the application boundary before passing them to the Header class
- Strip CR, LF, and NUL characters from any user-controlled data used in HTTP header construction
- Configure upstream WAFs with allowlists that accept legitimate CodeIgniter application traffic patterns
# Upgrade CodeIgniter to the patched version
composer require codeigniter4/framework:^4.5.8
composer update codeigniter4/framework
php spark --version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

