CVE-2026-33686 — Vulnerability in code16/sharp — CVE Details
Sharp is Vulnerable to Path Traversal via Unsanitized Extension in FileUtil
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.66%). Schedule for your next planned update.
Does your project use an affected code16/sharp version?
Paste your composer.lock to check it for CVE-2026-33686 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
A 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.
Detail
In 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.
Impact
Exploiting this flaw allows an authenticated attacker to manipulate file paths:
- 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
- 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.)
Patches
This 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
Credits
Reported by zaurgsynv.
Advisory Timeline
- First published March 25, 2026 (246 days ago).
- Last revised March 27, 2026 — 2 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
composer require "code16/sharp:^9.20.0"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Packagist (1).
| Package | Fixed In |
|---|---|
| code16/sharp Packagist · Affected: 7.0.0-alpha.1, 7.27.0, 7.7.2, v4.0-BETA1 (+306 more) | 9.20.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-22Path TraversalMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
References
Frequently Asked Questions
- What is CVE-2026-33686?
- Sharp is Vulnerable to Path Traversal via Unsanitized Extension in FileUtil. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
- How do I check if my project is affected by CVE-2026-33686?
- CVE-2026-33686 affects code16/sharp. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-33686 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 46.4% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-103035HIGH
TeamPass folder re-parenting authorization bypass
- CVE-2026-33687HIGH
Sharp has Unrestricted File Upload via Client-Controlled Validation Rules
- CVE-2026-110782HIGH
SAML2: Incomplete fix of CVE-2026-49283: unsigned embedded Response bypasses HTTP-Artifact signature verification (no embedded-Issuer binding)
- CVE-2026-61825HIGH
code16/sharp has a stored XSS via data-html-content Sanitizer Bypass