Security Vulnerability Report
中文
CVE-2026-33686 CVSS 8.8 HIGH

CVE-2026-33686

Published: 2026-03-26 22:16:31
Last Modified: 2026-04-01 12:26:41

Description

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.

CVSS Details

CVSS Score
8.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:code16:sharp:*:*:*:*:*:*:*:* - VULNERABLE
Sharp CMS < 9.20.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<?php /* * PoC for CVE-2026-33686 (Sharp CMS Path Traversal) * This demonstrates how a malicious filename can be constructed to exploit the vulnerability. */ // Simulating the vulnerable input $malicious_filename = "image.png/../../evil.php"; // In the vulnerable code, strrpos() splits at the last dot // The logic fails to sanitize path separators in the extension part // resulting in potential path traversal when saving the file. echo "Payload Filename: " . $malicious_filename . "\n"; echo "If uploaded via Sharp CMS < 9.20.0, this may write 'evil.php' to a parent directory.\n"; ?>

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33686", "sourceIdentifier": "[email protected]", "published": "2026-03-26T22:16:31.050", "lastModified": "2026-04-01T12:26:41.247", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}, {"lang": "es", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:code16:sharp:*:*:*:*:*:*:*:*", "versionEndExcluding": "9.20.0", "matchCriteriaId": "0D710527-04D5-4152-A28C-506356B95CE1"}]}]}], "references": [{"url": "https://github.com/code16/sharp/pull/715", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/code16/sharp/security/advisories/GHSA-9ffq-6457-8958", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}