{"id":"CVE-2025-22145","aliases":["CVE-2025-22145","GHSA-j3f9-p6hm-5w6q"],"related":[],"kind":"vulnerability","state":"published","title":"Carbon has an arbitrary file include via unvalidated input passed to Carbon::setLocale","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nApplication 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.\n\n### Patches\n- [3.8.4](https://github.com/briannesbitt/Carbon/releases/tag/3.8.4)\n- [2.72.6](https://github.com/briannesbitt/Carbon/releases/tag/2.72.6)\n\n### Workarounds\nAny of the below actions can be taken to prevent the issue:\n- Validate input before calling `setLocale()`, for instance by forbidding or removing `/` and `\\`\n- Call `setLocale()` only with a locale from a whitelist of supported locales\n- When uploading files, rename them so they cannot have a `.php` extension (this is recommended even if you're not affected by this issue)\n- 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)\n\n### References\nhttps://en.wikipedia.org/wiki/File_inclusion_vulnerability\n\n### Credits\nThanks to **Szczepan Hołyszewski** who reported the issue and to Tidelift to coordinate the resolution","format":"markdown","source":"ghsa"},{"lang":"es","text":"Carbon es una extensión internacional de PHP para DateTime. Las aplicaciones que pasan datos de usuario no saneados a Carbon::setLocale corren el riesgo de incluir archivos arbitrarios. Si la aplicación permite a los usuarios cargar archivos con la extensión .php en una carpeta que permite incluirlos o requiere leerlos, corren el riesgo de que se ejecute código arbitrario en sus servidores. Esta vulnerabilidad se corrigió en 3.8.4 y 2.72.6.","source":"nvd"}],"published":"2025-01-08T20:40:37.545Z","modified":"2026-06-17T08:45:20.153Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"}],"cwes":["CWE-98"],"affected":[{"ranges":[{"version":"< 2.72.6","status":"affected"},{"version":">= 3.0.0, < 3.8.4","status":"affected"}],"vendor":"CarbonPHP","product":"carbon","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0","status":"affected","fixed":"3.8.4"}],"ecosystem":"Packagist","package":"nesbot/carbon","purl":"pkg:composer/nesbot/carbon","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.72.6"}],"ecosystem":"Packagist","package":"nesbot/carbon","purl":"pkg:composer/nesbot/carbon","source":"ghsa"}],"references":[{"url":"https://github.com/CarbonPHP/carbon/security/advisories/GHSA-j3f9-p6hm-5w6q","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/briannesbitt/Carbon/commit/129700ed449b1f02d70272d2ac802357c8c30c58","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/02/msg00032.html","tags":["web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-22145","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/CarbonPHP/carbon","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-01-09T16:01:55.619Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-22145","url":"https://www.cve.org/CVERecord?id=CVE-2025-22145","licence":"CVE Terms of Use","modified":"2025-02-25T13:07:45.559Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j3f9-p6hm-5w6q","url":"https://github.com/advisories/GHSA-j3f9-p6hm-5w6q","licence":"CC-BY-4.0","modified":"2025-02-25T18:48:28.814Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-22145","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-22145","licence":"Public domain","modified":"2026-06-17T08:45:20.153Z"}],"updatedAt":"2026-11-25T22:58:53.172Z","epss":{"score":0.00753,"percentile":0.56275,"date":"2026-12-01T12:00:22.000Z"}}