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.
Any of the below actions can be taken to prevent the issue:
setLocale(), for instance by forbidding or removing / and \setLocale() only with a locale from a whitelist of supported locales.php extension (this is recommended even if you're not affected by this issue)https://en.wikipedia.org/wiki/File_inclusion_vulnerability
Thanks to Szczepan Hołyszewski who reported the issue and to Tidelift to coordinate the resolution
{
"cwe_ids": [
"CWE-98"
],
"github_reviewed": true,
"github_reviewed_at": "2025-01-08T21:03:28Z",
"nvd_published_at": "2025-01-08T21:15:13Z",
"severity": "MODERATE"
}