- Home
- Skills
- Testing & Debugging
- Repair Archive & Extraction Bugs
More screenshots
Works with the AI tools you already use
Repair Archive & Extraction Bugs
Repair Archive & Extraction Bugs is a bounded ToolForge Labs workflow.
$8.99
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.
What you get
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.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 21 days ago
- Passed all security checks, Safe to install