What’s Vulnerable › Vulnerabilities
CVE-2025-22145: Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale
- Severity: medium (CVSS 6.3 v4.0)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.8% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2025-01-08 · updated 2026-06-17
- Weakness: CWE-98
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.
Affected products
- Packagist Nesbot/Carbon: from 3.0.0 before 3.8.4; before 2.72.6; 3.0.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1, 3.2.0 (+236) — fixed in 3.8.4, 2.72.6
- CarbonPHP carbon: before 2.72.6; from 3.0.0, < 3.8.4
How to fix
Upgrade to a fixed version: Packagist Nesbot/Carbon 3.8.4, 2.72.6. Check the vendor advisory for mitigations.
References
- https://github.com/CarbonPHP/carbon/security/advisories/GHSA-j3f9-p6hm-5w6q
- https://github.com/briannesbitt/Carbon/commit/129700ed449b1f02d70272d2ac802357c8c30c58
- https://lists.debian.org/debian-lts-announce/2025/02/msg00032.html
Get alerted when CVE-2025-22145 or the next vulnerability affects your stack