Skip to main content

PHP CVE-2026-33686

HIGH
Path Traversal (CWE-22)
2026-03-25 https://github.com/code16/sharp
8.8
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to application
  2. Delivery
    Upload file with path traversal in extension
  3. Exploit
    Bypass extension sanitization
  4. Execution
    Write arbitrary file to filesystem
  5. Impact
    Execute code or access sensitive data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Authenticated user with upload privileges to code16/sharp package. Attacker uploads a file with path traversal characters in the extension (e.g., filename.php/../../../etc/passwd). No victim interaction required. Affects all versions with unsanitized FileUtil::explodeExtension() function.

Impact

The CVSS score of 8.8 (High) reflects network-accessible exploitation requiring only low-privilege authentication with no user interaction (AV:N/AC:L/PR:L/UI:N), resulting in high impact to confidentiality, integrity, and availability (C:H/I:H/A:H). Real-world risk is significant because a working Proof of Concept exists and the vulnerability can be chained with file upload issues to achieve arbitrary file write capabilities. The requirement for authentication (PR:L) provides some barrier to entry but does not significantly reduce risk in applications with user registration or where credentials can be obtained. The availability of a patch in pull request #715 means remediation is straightforward for organizations tracking their dependency chain. While no EPSS score or KEV status is provided in the intelligence, the combination of confirmed POC, clear attack path, and potential for overwriting critical configuration files makes this a genuine priority for organizations running affected versions of code16/sharp.

Exploit ScenarioDerived

An authenticated attacker with low-level privileges uploads a file with a crafted filename such as 'malicious.php/../../../.env', where the path traversal sequence is embedded in the extension component. The FileUtil class processes this filename, sanitizing only the base name while leaving the malicious extension intact, allowing the storeAs() function to write the file outside the intended tmp directory. The attacker successfully overwrites the application's .env file with malicious configuration, potentially including database credentials or API keys, leading to full application compromise.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 25, 2026

Authenticated attackers can bypass file path restrictions in PHP's code16/sharp package by injecting path separators into file extensions, enabling arbitrary file writes outside intended directories. The vulnerability stems from incomplete input sanitization in the FileUtil class where extensions are extracted but never validated before being passed to storage functions. A patch is available to address this high-severity path traversal issue affecting all users of the vulnerable package.

Earlier versions of this analysis (1)
v1 Mar 25, 2026 - 20:02 CVSS 8.8

A path traversal vulnerability in the FileUtil class of the code16/sharp PHP package allows authenticated attackers to write files outside the intended temporary directory and potentially overwrite critical system files such as .env or configuration files. The code16/sharp package (a PHP content management framework) fails to sanitize file extensions properly, allowing path separators to bypass validation. A Proof of Concept has been successfully demonstrated by the reporter, chaining this with CWE-434 (unrestricted file upload), and a patch is available in pull request #715.

RemediationAI

Update the code16/sharp package to the patched version incorporating the fixes from pull request #715 available at https://github.com/code16/sharp/pull/715. Consult the vendor security advisory at https://github.com/code16/sharp/security/advisories/GHSA-9ffq-6457-8958 for the specific patched version number and upgrade instructions via Composer. Until patching is complete, implement compensating controls such as restricting file upload functionality to highly trusted administrators only, implementing additional server-side validation of uploaded filenames and extensions, applying strict filesystem permissions to prevent overwriting critical files, and monitoring file system activity for suspicious write operations outside expected directories. Organizations should also review existing uploaded files for evidence of exploitation attempts.

Affected Packages

composer code16/sharp fix: 9.20.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in composer

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability affects code16/sharp, a PHP-based content management framework distributed as a Composer package (pkg:composer/code16_sharp). The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). The FileUtil::explodeExtension() function in src/Utils/FileUtil.php extracts file extensions using strrpos() to split at the last dot, but never sanitizes the extracted extension. While the application applies normalizeName() to clean the base filename, path separators (such as forward slashes) embedded in the extension component bypass sanitization and are passed directly to Laravel's storeAs() function. This allows directory traversal sequences to escape the intended storage directory. The patch replaces strrpos() with pathinfo(PATHINFO_EXTENSION) and applies strict regex validation to both filename components.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch released
Mar 25, 2026 - 20:02 nvd
Patch available
CVE Published
Mar 25, 2026 - 20:01 nvd
HIGH 8.8

DescriptionGitHub Advisory

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.

Executive ViewAI

Why It Matters

A high-severity vulnerability in the code16/sharp PHP package enables authenticated attackers to write files outside designated directories, potentially overwriting critical configuration files like .env and enabling full system compromise. Organizations using this package face immediate risk of data breach, service disruption, and loss of system control if exploited.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not feasible: restrict file upload functionality at application level; implement strict input validation for file extensions; deploy WAF rules to block path traversal patterns (../, ..\ sequences); limit file write permissions to dedicated, isolated directories with no access to configuration files; restrict access to the affected FileUtil class to administrative users only; monitor file system changes in critical directories.

Threat Intelligence Overview

EPSS Score
0.1%
Top 80% exploitable
Data Quality
4 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Affected Products (CPE)GitHub Advisory

pkg:composer/code16_sharp

Related Vulnerabilities in code16/sharp Path Traversal and File Upload

View all 2

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy