{"id":"CVE-2026-33686","aliases":["CVE-2026-33686","GHSA-9ffq-6457-8958"],"related":[],"kind":"vulnerability","state":"published","title":"Sharp is Vulnerable to Path Traversal via Unsanitized Extension in FileUtil","summary":"Sharp is a content management framework built for Laravel as a package. Versions prior to 9.20.0 have a path traversal vulnerability  in the FileUtil class. The application fails to sanitize file extensions properly, allowing path separators to be passed into the storage layer. In `src/Utils/FileUtil.php`, the `FileUtil::explodeExtension()` function extracts a file's extension by splitting the filename at the last dot. This issue has been patched in version 9.20.0 by properly sanitizing the extension using `pathinfo(PATHINFO_EXTENSION)` instead of `strrpos()`, alongside applying strict regex replacements to both the base name and the extension.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Sharp is a content management framework built for Laravel as a package. Versions prior to 9.20.0 have a path traversal vulnerability  in the FileUtil class. The application fails to sanitize file extensions properly, allowing path separators to be passed into the storage layer. In `src/Utils/FileUtil.php`, the `FileUtil::explodeExtension()` function extracts a file's extension by splitting the filename at the last dot. This issue has been patched in version 9.20.0 by properly sanitizing the extension using `pathinfo(PATHINFO_EXTENSION)` instead of `strrpos()`, alongside applying strict regex replacements to both the base name and the extension.","source":"cvelist"},{"lang":"en","text":"### Summary\nA path traversal vulnerability exists in the FileUtil class of the code16/sharp package. The application fails to sanitize file extensions properly, allowing path separators to be passed into the storage layer.\n\n### Detail\nIn `src/Utils/FileUtil.php`, the `FileUtil::explodeExtension()` function extracts a file's extension by splitting the filename at the last dot. However, the extracted extension is never sanitized. While the application uses a `normalizeName()` function, this function only cleans the base filename, meaning any path separators (such as /) injected into the extension will survive and be passed into the `storeAs()` function.\n\n### Impact\nExploiting this flaw allows an authenticated attacker to manipulate file paths:\n- Files can be written outside of the intended tmp directory via path traversal. For more details on the package, visit: https://github.com/code16/sharp\n- Existing critical files (such as .env or configuration files) could potentially be overwritten. Review the CWE definition here: https://cwe.mitre.org/data/definitions/22.html (Note: This vulnerability was successfully chained with CWE-434 in a local Proof of Concept to confirm the traversal.)\n\n### Patches\nThis issue has been patched by properly sanitizing the extension using `pathinfo(PATHINFO_EXTENSION)` instead of `strrpos()`, alongside applying strict regex replacements to both the base name and the extension. The fix is available in pull request #715\n\n### Credits\nReported by [zaurgsynv](https://github.com/zaurgsynv).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Sharp es un framework de gestión de contenido construido para Laravel como un paquete. Las versiones anteriores a la 9.20.0 tienen una vulnerabilidad de salto de ruta en la clase FileUtil. La aplicación no sanitiza las extensiones de archivo correctamente, permitiendo que los separadores de ruta se pasen a la capa de almacenamiento. En 'src/Utils/FileUtil.php', la función 'FileUtil::explodeExtension()' extrae la extensión de un archivo dividiendo el nombre del archivo en el último punto. Este problema ha sido parcheado en la versión 9.20.0 sanitizando correctamente la extensión usando 'pathinfo(PATHINFO_EXTENSION)' en lugar de 'strrpos()', junto con la aplicación de reemplazos de expresiones regulares estrictos tanto al nombre base como a la extensión.","source":"nvd"}],"published":"2026-03-25T20:01:04.000Z","modified":"2026-06-17T10:37:55.513Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 9.20.0","status":"affected"}],"vendor":"code16","product":"sharp","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"9.20.0"}],"ecosystem":"Packagist","package":"code16/sharp","purl":"pkg:composer/code16/sharp","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"9.20.0"}],"vendor":"code16","product":"sharp","cpe":"cpe:2.3:a:code16:sharp:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/code16/sharp/security/advisories/GHSA-9ffq-6457-8958","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/code16/sharp/pull/715","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33686","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/code16/sharp","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-03-27T13:59:38.470Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33686","url":"https://www.cve.org/CVERecord?id=CVE-2026-33686","licence":"CVE Terms of Use","modified":"2026-03-27T13:59:50.752Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9ffq-6457-8958","url":"https://github.com/advisories/GHSA-9ffq-6457-8958","licence":"CC-BY-4.0","modified":"2026-03-27T21:49:58.767Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33686","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33686","licence":"Public domain","modified":"2026-06-17T10:37:55.513Z"}],"updatedAt":"2026-11-25T22:59:17.339Z","epss":{"score":0.00604,"percentile":0.50291,"date":"2026-12-02T12:00:21.000Z"}}