PHP Remote File Inclusion Affecting nesbot/carbon package, versions <2.72.6>=3.0.0, <3.8.4


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.04% (12th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-NESBOTCARBON-8604278
  • published9 Jan 2025
  • disclosed8 Jan 2025
  • creditSzczepan Hołyszewski

Introduced: 8 Jan 2025

NewCVE-2025-22145  (opens in a new tab)
CWE-98  (opens in a new tab)

How to fix?

Upgrade nesbot/carbon to version 2.72.6, 3.8.4 or higher.

Overview

Affected versions of this package are vulnerable to PHP Remote File Inclusion via the setLocale method. An attacker can include arbitrary files and execute code by passing unvalidated input that leads to file inclusion.

Note:

This is only exploitable if the application allows file uploads with a .php extension in a directory that permits include or require statements to execute the file.

Workaround

This vulnerability can be mitigated by validating input before calling setLocale, using a whitelist for locales, renaming uploaded files to avoid .php extensions, or using remote or securely managed local storage systems for file uploads.

References

CVSS Scores

version 4.0
version 3.1