CVE-2025-22145 Details
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.
A vulnerability allowing arbitrary file inclusion has been identified in the Carbon PHP library, specifically in versions 3.0.0 prior to 3.8.4 and 2.72.6 prior to 2.72.6. This issue arises when applications pass unsanitized user input to the Carbon::setLocale method. If the application permits users to upload files with a .php extension to a directory that allows those files to be included or required, there is a risk of arbitrary code execution on the server.
Users can upgrade to Carbon versions 3.8.4 or 2.72.6 to address this vulnerability. For applications using Carbon, it is also recommended to validate and sanitize user input before passing it to the setLocale method. Additionally, consider using a storage system that is not local to the application, such as a remote service or a local service run by another user, to handle uploaded files.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jan 8, 2025CISA-ADP
Assessed Jan 9, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://lists.debian.org/debian-lts-announce/2025/02/msg00032.html | CVE | AdvisoryMailing ListRemedyVendor |
| https://github.com/briannesbitt/Carbon/commit/129700ed449b1f02d70272d2ac802357c8c30c58 | [email protected] | Source CodeVendor |
| https://github.com/CarbonPHP/carbon/security/advisories/GHSA-j3f9-p6hm-5w6q | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-98 | Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| nesbot/carbon | All versions |
CPE
Remediation
| |
| php-nesbot-carbon | All versions |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Feb 25, 2025 | CVE Modified | CVE |
| Jan 8, 2025 | New CVE Received | [email protected] |
Volerion