Critical severityCISA KEVNVD Advisory· Published Dec 18, 2024· Updated Oct 21, 2025
RCE when PHP `register_argc_argv` config setting is enabled in craftcms/cms
CVE-2024-56145
Description
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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
craftcms/cmsPackagist | >= 5.0.0-RC1, < 5.5.2 | 5.5.2 |
craftcms/cmsPackagist | >= 4.0.0-RC1, < 4.13.2 | 4.13.2 |
craftcms/cmsPackagist | >= 3.0.0, < 3.9.14 | 3.9.14 |
Affected products
1Patches
182e893fb794dFixed an RCE vulnerability
2 files changed · +14 −7
bootstrap/bootstrap.php+10 −7 modified@@ -27,8 +27,15 @@ // Determine the paths // ----------------------------------------------------------------------------- -$findConfig = function(string $cliName, string $envName) { - return App::cliOption($cliName, true) ?? App::env($envName); +$findConfig = function(string $cliName, string $envName) use ($appType) { + if ($appType === 'console') { + $value = App::cliOption($cliName, true); + if ($value !== null) { + return $value; + } + } + + return App::env($envName); }; // Set the vendor path. By default assume that it's 4 levels up from here @@ -49,11 +56,7 @@ // Set the environment // ----------------------------------------------------------------------------- -$environment = App::cliOption('--env', true) - ?? App::env('CRAFT_ENVIRONMENT') - ?? App::env('ENVIRONMENT') - ?? $_SERVER['SERVER_NAME'] - ?? null; +$environment = $findConfig('--env', 'CRAFT_ENVIRONMENT') ?? App::env('ENVIRONMENT') ?? $_SERVER['SERVER_NAME'] ?? null; // Load the general config // -----------------------------------------------------------------------------
CHANGELOG.md+4 −0 modified@@ -1,5 +1,9 @@ # Release Notes for Craft CMS 4 +## Unreleased + +- Fixed an RCE vulnerability. + ## 4.13.1.1 - 2024-11-18 - Fixed a PHP error. ([#16142](https://github.com/craftcms/cms/issues/16142))
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-2p6p-9rc9-62j9ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-56145ghsaADVISORY
- github.com/craftcms/cms/commit/82e893fb794d30563da296bca31379c0df0079b3ghsax_refsource_MISCWEB
- github.com/craftcms/cms/security/advisories/GHSA-2p6p-9rc9-62j9ghsax_refsource_CONFIRMWEB
- www.cisa.gov/known-exploited-vulnerabilities-catalogghsaWEB
News mentions
0No linked articles in our index yet.