CVE-2025-22145
Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
6.3
Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale
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.
- Record
CVE-2025-22145- CVSS 4.0
- 6.3 Medium
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-98
- Updated
- 2026-11-02
EUVDEUVD-2025-0030
6.3
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.
- Record
EUVD-2025-0030- CVSS 4.0
- 6.3 Medium
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-j3f9-p6hm-5w6q
6.3
Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale
Impact
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.
Patches
Workarounds
Any of the below actions can be taken to prevent the issue:
- Validate input before calling
setLocale(), for instance by forbidding or removing/and\ - Call
setLocale()only with a locale from a whitelist of supported locales - When uploading files, rename them so they cannot have a
.phpextension (this is recommended even if you're not affected by this issue) - Prefer storage system that are not local to the application (remote service, or local service ran by another user so the uploaded files actually live outside of the application basedir)
References
https://en.wikipedia.org/wiki/File_inclusion_vulnerability
Credits
Thanks to Szczepan Hołyszewski who reported the issue and to Tidelift to coordinate the resolution
- Record
GHSA-j3f9-p6hm-5w6q- CVSS 4.0
- 6.3 Medium
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-98
- Updated
- 2026-11-02
NVD
6.3
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.
- Record
CVE-2025-22145- CVSS 4.0
- 6.3 Medium
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-98
- Updated
- 2026-11-02
OSV
6.3
Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale
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.
- Record
CVE-2025-22145- CVSS 4.0
- 6.3 Medium
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-98
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2025-22145
6.3
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.
- Record
DEBIAN-CVE-2025-22145- CVSS 4.0
- 6.3 Medium
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
Show 4 moreShow less
OSVGHSA-j3f9-p6hm-5w6q
6.3
Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale
Impact
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.
Patches
Workarounds
Any of the below actions can be taken to prevent the issue:
- Validate input before calling
setLocale(), for instance by forbidding or removing/and\ - Call
setLocale()only with a locale from a whitelist of supported locales - When uploading files, rename them so they cannot have a
.phpextension (this is recommended even if you're not affected by this issue) - Prefer storage system that are not local to the application (remote service, or local service ran by another user so the uploaded files actually live outside of the application basedir)
References
https://en.wikipedia.org/wiki/File_inclusion_vulnerability
Credits
Thanks to Szczepan Hołyszewski who reported the issue and to Tidelift to coordinate the resolution
- Record
GHSA-j3f9-p6hm-5w6q- CVSS 4.0
- 6.3 Medium
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - Weakness
- CWE-98
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2025-22145
6.3
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.
- Record
UBUNTU-CVE-2025-22145- CVSS 4.0
- 6.3 Medium
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N - Updated
- 2026-11-02
OSVCLSA-2025-1756946896 No score
TuxCare security update for nesbot/carbon (1 CVE)
TuxCare rebuilt nesbot/carbon to address 1 CVE. Fixed in 1.26.6-p1+tuxcare.
- Record
CLSA-2025-1756946896- Updated
- 2026-11-02
OSVCLSA-2026-1771375695 No score
TuxCare security update for nesbot/carbon (1 CVE)
TuxCare rebuilt nesbot/carbon to address 1 CVE. Fixed in 1.39.1-p1+tuxcare.
- Record
CLSA-2026-1771375695- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
nesbot/carbonPackagist |
3.0.0 up to 3.8.4 | 3.8.4 |
nesbot/carbonPackagist |
before 2.72.6 | 2.72.6 |
nesbot/carbonTuxCare:Packagist |
1.26.6 up to 1.26.6-p1+tuxcare | 1.26.6-p1+tuxcare |
nesbot/carbonTuxCare:Packagist |
1.39.1 up to 1.39.1-p1+tuxcare | 1.39.1-p1+tuxcare |
php-nesbot-carbonDebian:12 |
before 2.65.0-1+deb12u1, plus listed versions 2.65.0-1 |
2.65.0-1+deb12u1 |
php-nesbot-carbonDebian:13 |
before 2.72.6-1 | 2.72.6-1 |
php-nesbot-carbonDebian:14 |
before 2.72.6-1 | 2.72.6-1 |
php-nesbot-carbonDebian:11 |
before 2.32.2-1+deb11u1, plus listed versions 2.32.2-1 |
2.32.2-1+deb11u1 |
nesbot/carbonPackagist |
3.0.0 up to 3.8.4, plus listed versions 3.0.13.0.23.1.03.1.13.2.0 Show 14 moreShow less3.2.13.2.23.2.33.2.43.3.03.3.13.4.03.5.03.6.03.7.03.8.03.8.13.8.23.8.3 |
3.8.4 |
nesbot/carbonPackagist |
before 2.72.6, plus listed versions 1.0.01.0.11.1.01.10.01.11.0 Show 45 moreShow less1.12.01.13.01.14.01.15.01.16.01.17.01.18.01.19.01.2.01.20.01.21.01.22.01.22.11.23.01.24.01.24.11.24.21.25.01.25.11.25.31.26.01.26.11.26.21.26.31.26.41.26.51.26.61.27.01.28.01.29.01.29.11.29.21.3.01.30.01.31.01.31.11.32.01.33.01.34.01.34.11.34.21.34.31.34.41.35.01.35.1 |
2.72.6 |
php-nesbot-carbonUbuntu:20.04:LTS |
All versions, plus listed versions 1.27.0-2 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-22145 is a medium vulnerability (CVSS 6.3) in Carbonphp Carbon, published January 8, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.75%, the 55th percentile. Fixed in nesbot/carbon 3.8.4.
References
github.com/CarbonPHP/carbon/security/advisories/GHSA-j3f9-p6hm-5w6q
github.com/briannesbitt/Carbon/commit/129700ed449b1f02d70272d2ac802357c8c30c58
lists.debian.org/debian-lts-announce/2025/02/msg00032.html
nvd.nist.gov/vuln/detail/CVE-2025-22145
github.com/advisories/GHSA-j3f9-p6hm-5w6q
github.com/CVEProject/cvelistV5/tree/main/cves/2025/22xxx/CVE-2025-22145.json
Left out here: 172 versions. The JSON record has them.