November 19, 2026
ZIP SLIP TO ROOT: Turning a ZIP Upload into Remote Code Execution | CYBER TAMARIN
A seemingly harmless ZIP upload. A carefully crafted archive. An extraction process that trusts user-controlled paths. The resultβ¦

By Cyber Tamarin
3 min read
A seemingly harmless ZIP upload. A carefully crafted archive. An extraction process that trusts user-controlled paths. The result? Potential arbitrary file write and Remote Code Execution.
Not every critical vulnerability requires sophisticated exploitation techniques.
Sometimes, the most interesting vulnerabilities hide behind ordinary application functionality.
During a recent private penetration testing engagement, I encountered a file upload feature that accepted ZIP archives for administrative operations. What initially appeared to be a standard archive upload mechanism eventually revealed a potentially serious security weakness.
The objective was simple: determine whether the application safely handled uploaded archives or blindly trusted their contents.
The result was interesting.
01. RECONNAISSANCE β IDENTIFYING THE ENTRY POINT
I started with a black-box assessment of the application's administrative functionalities.
While exploring the available features, I identified multiple operations that accepted ZIP archives, including:
- Template management
- Plugin management
- Backup management
- Application updates
Rather than focusing only on whether the application accepted a particular file extension or MIME type, I wanted to understand how the application processed the uploaded archive.
The important question was:
Does the application safely extract the contents of an uploaded ZIP archive?
That became the primary testing objective.
02. TESTING THE EXTRACTION MECHANISM
I began examining the ZIP upload functionality by preparing controlled archives with different directory structures.
The focus was on identifying whether archive entries could influence the final extraction location.
I constructed a specially crafted ZIP archive containing directory traversal sequences such as:
evil/
evil/../../tmp/pwned.txtevil/
evil/../../tmp/pwned.txtThe archive was then submitted through the application's administrative upload functionality.
The objective was to determine whether files could escape the intended extraction directory.
This was not a conventional unrestricted file upload test. The application accepted the archive as expected, but the security concern was what happened during extraction.
The extraction process did not adequately enforce the intended directory boundaries.
This indicated a potential Zip Slip vulnerability.
03. EXPLOITATION β ESCAPING THE EXTRACTION DIRECTORY
The next step was to understand how different upload functionalities handled the crafted archive.
I tested the available archive-processing workflows and compared their extraction behavior.
One functionality stood out: the application update mechanism.
Unlike the template management workflow, which performed a basic check for an expected archive entry, the update workflow did not provide an equivalent validation safeguard.
More importantly, the update process extracted archive contents into the application's root directory.
This significantly expanded the potential impact.
The issue was no longer limited to writing files within a particular template or plugin directory. Depending on the traversal path and filesystem permissions, the extraction process could potentially reach other application files.
04. IMPACT VALIDATION β FROM FILE WRITE TO RCE
Finding a path traversal issue is one thing. Demonstrating its actual security impact is another.
I evaluated whether the extraction behavior could be abused to place attacker-controlled files in locations processed by the web server.
Because the application supported PHP-based templates and plugins, the possibility of writing PHP files into executable application directories was particularly concerning.
Under suitable conditions, this could establish the following exploitation chain:
AUTHENTICATED ADMIN
|
v
ZIP ARCHIVE UPLOAD
|
v
CRAFTED ARCHIVE ENTRIES
|
v
PATH TRAVERSAL
|
v
ARBITRARY FILE WRITE
|
v
PHP FILE IN WEB DIRECTORY
|
v
REMOTE CODE EXECUTION AUTHENTICATED ADMIN
|
v
ZIP ARCHIVE UPLOAD
|
v
CRAFTED ARCHIVE ENTRIES
|
v
PATH TRAVERSAL
|
v
ARBITRARY FILE WRITE
|
v
PHP FILE IN WEB DIRECTORY
|
v
REMOTE CODE EXECUTIONThe important finding was that an attacker with the required administrative access could potentially leverage unsafe archive extraction to achieve server-side code execution.
The resulting execution would occur with the privileges of the web server process.
05. WHY THIS WAS INTERESTING
What made this vulnerability particularly interesting was the number of administrative functionalities relying on archive extraction.
A weakness in one archive-processing mechanism potentially affected several application features.
The update functionality was especially concerning because its extraction destination was the application root.
Potential security consequences included:
- Arbitrary file creation outside intended upload directories.
- Overwriting existing application files.
- Modification of sensitive configuration files where reachable.
- Placement of executable PHP files within web-accessible directories.
- Potential Remote Code Execution.
Although administrative authentication was required, the impact of successful exploitation could extend beyond the privileges normally associated with file upload functionality.
06. REMEDIATION β SECURING THE EXTRACTION PROCESS
The recommended remediation is to treat every uploaded archive as untrusted input.
The application should:
- Validate every ZIP entry before extraction.
- Reject directory traversal sequences and absolute paths.
- Resolve and canonicalize destination paths before writing files.
- Ensure every destination remains within the approved extraction directory.
- Extract archives into isolated temporary locations before deployment.
- Apply consistent validation across all archive upload functionalities.
- Restrict write permissions on sensitive application directories and configuration files.
Simply checking whether an expected file exists inside an archive is not sufficient. Every archive entry must be validated independently.
07. FINAL THOUGHTS
This engagement was a good reminder that black-box penetration testing should go beyond checking whether an application accepts malicious-looking input.
The real security question is what the application does with that input after accepting it.
A ZIP archive is just a container. But when an application blindly trusts the paths contained inside it, that container can become an entry point for filesystem manipulation and potentially remote code execution.
One upload functionality. One missing security boundary. Multiple potential exploitation paths.
Sometimes, the road to RCE starts with something as ordinary as extracting a ZIP file.
Break the assumptions. Trace the behavior. Exploit the weakness.
Thanks for reading.
Cyber Tamarin out.π