CVE-2024-56145·PHP vulnerability
Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond. Users of affected versions are affected by this vulnerability if their php.ini configuration has `register_argc_argv` enabled. For these users an unspecified remote code execution vector is present. Users are advised to update to version 3.9.14, 4.13.2, or 5.5.2. Users unable to upgrade should disable `register_argc_argv` to mitigate the issue.
- Severity
- critical
- Software
- PHP
- Fixed in
- 5.5.2
- Published
- 2024-12-18
Affected versions
From: 5.0.0
Until: 5.5.2
Fixed in: 5.5.2
How to fix this CVE
Upgrade PHP to version 5.5.2 or later to patch the remote code execution vulnerability triggered through the `register_argc_argv` PHP directive. If immediate patching is not possible, disable `register_argc_argv` in your php.ini configuration file as an interim mitigation. This vulnerability is actively exploited in the wild and requires urgent attention.
sudo dnf update phpDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST|GET requests containing encoded or plaintext ARGV injection patterns in query strings or request bodies (e.g., `$_SERVER['argv']`, `argc=`, `argv=`); payloads attempting to set PHP variables via HTTP parameters when register_argc_argv is enabledWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Implement WAF rules to block HTTP requests containing suspicious `argv` or `argc` parameters in the query string or POST body. Additionally, block requests with PHP variable assignment syntax in user-controlled input (e.g., patterns matching `\$[a-zA-Z_][a-zA-Z0-9_]*\s*=`).How to check if you are affected
- Check installed PHP version: php -v
- Verify if register_argc_argv is enabled: php -r 'echo ini_get("register_argc_argv") ? "ENABLED - VULNERABLE" : "DISABLED - SAFE";'
- Search web server access logs for suspicious argument injection patterns: grep -i 'argc\|argv' /var/log/apache2/access.log /var/log/nginx/access.log
- Confirm patch installation: php -v should show version 5.5.2 or higher, and re-run the register_argc_argv check to ensure it remains disabled
FAQ
What is CVE-2024-56145?
CVE-2024-56145 is a critical remote code execution vulnerability in PHP that exploits the `register_argc_argv` configuration directive, allowing attackers to inject and execute arbitrary code on affected servers without authentication.
Is CVE-2024-56145 being actively exploited?
Yes, this vulnerability is actively exploited in the wild and is tracked by CISA in their Known Exploited Vulnerabilities catalog. Threat actors are actively weaponizing this flaw against production systems.
What versions of PHP are affected by CVE-2024-56145?
PHP versions 5.0.0 through 5.5.1 are vulnerable. Version 5.5.2 and later include the security patch. Earlier versions (3.9.14, 4.13.2) also have fixes available.
How do I check if my server is vulnerable to CVE-2024-56145?
Run: php -v to confirm version is below 5.5.2, then run: php -r 'echo ini_get("register_argc_argv") ? "VULNERABLE" : "PROTECTED";' If both conditions are true, your server is exploitable.
Does Defensia detect CVE-2024-56145?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PHP is installed on a monitored server, CVE-2024-56145 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-56145. Free for 1 server.
Get started free