CVE-2025-22145 Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale

Medium 6.3 Published Updated

Attackers can achieve arbitrary code execution if applications pass unsanitized input to Carbon::setLocale and allow PHP file uploads.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-22145?

CVE-2025-22145 is a medium-severity vulnerability in CarbonPHP carbon, published on 8 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Carbon is an international PHP extension for DateTime. Application passing unsanitized user input to Carbon::setLocale are at risk of arbitrary file include, if the application allows users to upload files with .php extension in an folder that allows include or require to read it, then they are at risk of arbitrary code ran on their servers. This vulnerability is fixed in 3.8.4 and 2.72.6.

Weakness: CWE-98

Which versions are affected by CVE-2025-22145?

4 open source packages ship an affected version, including nesbot/carbon.

PackageAffectedFixed in
nesbot/carbon PackagistAll versions2.72.6
nesbot/carbon PackagistAll versions2.72.6
nesbot/carbon PackagistFrom 3.0.03.8.4
nesbot/carbon PackagistFrom 3.0.03.8.4

How do I fix CVE-2025-22145?

Upgrade nesbot/carbon to a fixed version for your release line: 2.72.6 or 3.8.4.

Is CVE-2025-22145 being exploited?

There is no known exploitation of CVE-2025-22145 in the wild and no public exploit code.

Sources

Also known as CLSA-2025-1756946896, CLSA-2026-1771375695, DEBIAN-CVE-2025-22145, DLA-4068-1, GHSA-j3f9-p6hm-5w6q, UBUNTU-CVE-2025-22145.

Is CVE-2025-22145 in your software?

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

Check your SBOMs for free