- Home
- Skills
- Testing & Debugging
- Repair Archive & Extraction Bugs
More screenshots
Works with the AI Agents you already use
Repair Archive & Extraction Bugs
Repair Archive & Extraction Bugs is a bounded ToolForge Labs workflow.
$1
Repair Archive & Extraction Bugs
Example session with this skill installed
I have a Node.js extraction function using adm-zip that is vulnerable to path traversal. Fix it to ensure files only extract to /tmp/app/data and handle symlinks safely.
- Read your context and instructions
- Compiled the repair archive
I have analyzed the extraction logic and identified the missing path normalization and symlink validation steps. I have implemented a bounded repair that enforces the /tmp/app/data root invariant.
Secure Extraction Repair
const admZip = require('adm-zip');
const path = require('path');
const fs = require('fs');
function secureExtract(zipPath, targetDir) {
const zip = new admZip(zipPath);
const resolvedTarget = path.resolve(targetDir);
zip.getEntries().forEach((entry) => {
// 1. Path Traversal Protection (Zip-Slip)
const entryPath = entry.entryName;
const fullPath = path.resolve(resolvedTarget, entryPath);
if (!fullPath.startsWith(resolvedTarget)) {
throw new Error(`Security Alert: Blocked path traversal attempt in ${entryPath}`);
}
// 2. Symlink Policy Enforcement
if (entry.isSymbolicLink) {
// In this repair, we block symlinks to prevent arbitrary read/write via link targets
console.warn(`Skipping symlink: ${entryPath}`);
return;
}
// 3. Directory Creation and Extraction
if (entry.isDirectory) {
fs.mkdirSync(fullPath, { recursive: true });
} else {
const mode = entry.attr >>> 16 & 0xFFF; // Preserve permissions safely
zip.extractEntryTo(entry, resolvedTarget, false, true);
fs.chmodSync(fullPath, mode || 0o644);
}
});
}
Next steps
- Verify Root Path: Ensure the runtime user has write permissions specifically to
/tmp/app/data.
Integration Test: Run the provided implementation against a test archive containing ../ sequences to confirm the traversal block.
3.
Resource Limits: If handling large archives, consider migrating this logic to unzipper with a stream-based buffer to avoid memory exhaustion.
Connects securely to your tools. The creator never sees your data.
About this skill
Repair Archive & Extraction Bugs is a bounded ToolForge Labs workflow. Repair archive creation/extraction failures across ZIP/TAR/GZIP, Unicode names, symlinks, path traversal, permissions, truncation, streaming, resource limits, atomic publication, and cleanup. Works from repositories or partial code/archive evidence. Produces safe bounded repairs and deterministic malicious/edge fixtures. It works from a full repository or partial evidence such as snippets, logs, configuration, traces, tickets, and architecture notes. The skill preserves existing product and security policy, separates verified facts from assumptions, avoids invented execution claims, and produces concrete repair or review steps with focused deterministic validation or traceable evidence.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.
Cannot verify production systems, external services, or facts that are not present in supplied evidence. With partial context it returns bounded diagnosis/review, explicit assumptions, and a deterministic validation plan rather than claiming successful execution.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
Permissions
Use a clean branch or a controlled review workspace. Supply repository files, logs, traces, configuration, or evidence needed for the task. Review all patches/findings before merge or operational action; keep production credentials and destructive production actions out of the workflow.