CVE-2024-56145 Craft CMS Code Injection

Exploited in the wild Critical 9.3 Published Updated

Remote code execution is possible in Craft CMS when the PHP register_argc_argv setting is enabled, requiring an upgrade or configuration change.

Exploited in the wild
Since 2 Jun 2025
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-56145?

CVE-2024-56145 is a critical code injection vulnerability in Craftcms Craft Cms, published on 18 Dec 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-94

Which versions are affected by CVE-2024-56145?

6 open source packages ship an affected version, including craftcms/cms. It affects 1 product.

PackageAffectedFixed in
craftcms/cms PackagistFrom 3.0.03.9.14
craftcms/cms PackagistFrom 3.0.03.9.14
craftcms/cms PackagistFrom 4.0.0-RC14.13.2
craftcms/cms PackagistFrom 4.0.0-RC14.13.2
craftcms/cms PackagistFrom 5.0.0-RC15.5.2
craftcms/cms PackagistFrom 5.0.0-RC15.5.2

Products include Craftcms Craft Cms.

How do I fix CVE-2024-56145?

Upgrade craftcms/cms to a fixed version for your release line: 3.9.14, 4.13.2 or 5.5.2. US federal agencies must fix it by 23 Jun 2025.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2024-56145 being exploited?

Yes. Attackers have exploited CVE-2024-56145 in the wild since at least 2 Jun 2025.

Public exploit code: 1 Metasploit module, 1 Nuclei template and 3 proofs of concept on GitHub.

All Craftcms Craft Cms vulnerabilities

Sources

Also known as GHSA-2p6p-9rc9-62j9.

Is CVE-2024-56145 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free