Loading...
Skip to main content

CVE-2025-22145 — Vulnerability in nesbot/carbon — CVE Details

MEDIUM

Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale

Published January 8, 2025Updated February 25, 2025Source: osv

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.11%). Schedule for your next planned update.

Summary

### 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 - [3.8.4](https://github.com/briannesbitt/Carbon/releases/tag/3.8.4) - [2.72.6](https://github.com/briannesbitt/Carbon/releases/tag/2.72.6) ### 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 `.php` extension (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

Advisory Timeline

  • First published January 8, 2025 (642 days ago).
  • Last revised February 25, 2025 — 48 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update nesbot/carbon to 2.72.6 or later
composer require "nesbot/carbon:^2.72.6"
Composer
Update nesbot/carbon to 3.8.4 or later
composer require "nesbot/carbon:^3.8.4"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: packagist (1).

PackageEcosystemAffectedFixed In
nesbot/carbon
packagist
1.0.0, 1.0.1, 1.1.0, 1.10.0 (+218 more)2.72.6
nesbot/carbon
packagist
3.0.0, 3.0.1, 3.0.2, 3.1.0 (+16 more)3.8.4

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

Frequently Asked Questions

What is CVE-2025-22145?
Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.8/10).
How do I check if my project is affected by CVE-2025-22145?
CVE-2025-22145 affects nesbot/carbon. It has a 0.1% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-22145 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.8

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

EPSS Score (30-day exploit probability)
0.11%
Higher than 30% of vulnerabilities

This is a below-median EPSS score — only 30% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-j3f9-p6hm-5w6q

Related CVEs

  • CVE-2026-75592
    MEDIUM

    Kirby: Access to image files outside of the site root via path traversal in the media handling

  • CVE-2026-88023
    MEDIUM

    MongoDB: GridFS data disclosure and deletion via query-operator injection in file IDs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies