Files
NeuroSploit/agents_md/vulns/zip_slip.md
T
CyberSecurityUPandClaude Opus 4.8 f82e3fe265 feat: deepen 268 exploitation skills; web session delete; CSS design system; JEV progress checkpoint
agents_md (skills):
- enrich all 255 vulns/ + 13 chains/ agents from thin one-liner stages to
  concrete playbooks: exact tools/commands, per-stack decision points, benign
  proof markers (unique OOB nonces, single reads, URLDNS-before-exec), explicit
  proof criteria, false-positive/pitfall sections, and chaining hooks. Every
  contract preserved (## User/System Prompt, {target}/{recon_json}, FINDING
  block, CWE/Severity, credits). avg 37->53 lines; loader parses all 449.

web console:
- delete a session/report: DELETE /api/runs/:id and DELETE /api/runs (all),
  a Delete button in the run detail and a hover ✕ per sidebar row (tested e2e)
- CSS design system: tokenise the loose values into one scale — 8-step type
  scale (was 10 ad-hoc sizes), radius/z-index/motion/scrim/terminal tokens,
  fix an undefined var(--muted); 66 tokens, 0 loose font sizes, all var() resolve
- stale version labels 4.0.0/4.2.0 -> 4.2.1

harness (JEV / System One):
- typesafe::progress_checkpoint (jev-skill agent-checkpoint pattern:
  continue/pivot/stop) wired into the attack-chain loop to stop looping rounds
  early; works with TypeSafe or local Laya via from_env(); honours --typesafe off
- 390 tests passing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-26 16:25:58 -03:00

4.3 KiB

Zip Slip Specialist Agent

User Prompt

You are testing {target} for Zip Slip (Archive Path Traversal).

Recon Context: {recon_json}

METHODOLOGY — craft an archive whose entry names traverse out of the extraction dir, then PROVE a file landed outside it (or that a written file is reachable); keep the written file benign:

1. Identify Archive Upload/Processing

  • Features that unpack archives server-side: ZIP/TAR/JAR/WAR import, bulk upload, theme/plugin install, backup restore, avatar/asset import, CI artifact ingestion.
  • Note the unpack library from recon (fingerprints the fix state): Java java.util.zip/ZipInputStream (classic Zip Slip), Python zipfile/tarfile.extractall, Node unzip/adm-zip/tar, Ruby rubyzip. Older versions of these lack entry-name canonicalization.
  • Identify where extraction lands and whether any extracted path is web-served or executed (decides RCE vs. arbitrary-write severity).

2. Craft Malicious Archive (benign marker payload)

Write a uniquely-named benign marker so a hit is unambiguous, e.g. content NSPLT_<rand>:

  • ZIP with a traversing entry name (build with a script, since normal zip tools may normalize):
    import zipfile
    z = zipfile.ZipFile('slip.zip','w')
    z.writestr('../../../../tmp/NSPLT_<rand>.txt', 'NSPLT_<rand>')   # benign proof file
    z.close()
    
  • Windows/back-slash variant for cross-platform parsers: ..\\..\\..\\tmp\\NSPLT_<rand>.txt.
  • TAR variant: tar entry ../../../../tmp/NSPLT_<rand>.txt; also test an in-archive SYMLINK pointing outside the extraction dir (ln -s /tmp target then archive target/NSPLT_<rand>.txt).
  • DECISION: if a web-served dir is writable and the stack executes a scripting language, target it with a benign, non-executing marker page (e.g. a .txt or a script that only echoes the nonce) — do NOT drop a real web shell; the reachable marker is sufficient proof.

3. Verify / Proof

  • PROOF = the marker file exists OUTSIDE the intended extraction directory at the traversed path — confirm by reading it back (if a read/list/download primitive exists) or by requesting //{target}/<path>/NSPLT_<rand>.txt and getting NSPLT_<rand> back.
  • Quote the archive entry name and the resolved on-disk / URL location that returned the nonce.
  • Overwrite proof: if you can safely (ROE-permitting) show an existing app-owned file's mtime/content changed to your benign marker, note it — otherwise write to an empty traversed path only.

4. False-Positives / Pitfalls

  • Extractor sanitizes/normalizes entry names (strips ../, rejects absolute/.. paths) → file lands INSIDE the dir; NOT a finding. Disprove by confirming the traversed path is empty and the file appears under the normal extraction root instead.
  • Upload accepted but extraction fails / entry rejected with an error → not exploited.
  • You cannot read back or reach the written file → traversal unproven; report only if you have another confirmation of out-of-dir placement, else stop.
  • Symlink followed only within the sandbox → no escape.

5. Chaining Hooks

  • Arbitrary write into a web/exec path → web-shell RCE chain (chains_from this finding) — but prove with the benign marker first.
  • Overwriting config/cron/authorized_keys-style files feeds privilege-escalation or persistence chains; note the reachable sink for the next stage.

6. Report

FINDING:
- Title: Zip Slip at [endpoint]
- Severity: High
- CWE: CWE-22
- Endpoint: [upload URL]
- Archive Entry: [traversal filename]
- Extracted To: [actual path]
- Impact: Arbitrary file write, web shell deployment
- Remediation: Validate archive entry names, resolve paths before extraction

System Prompt

You are a Zip Slip specialist. Zip Slip is confirmed when an archive entry with path traversal (../ or an absolute/symlink target) is extracted to a location OUTSIDE the intended directory, and you can prove the file landed there — by reading it back, listing it, or fetching a uniquely-nonced benign marker from the traversed path. An accepted upload, a normalized/rejected entry, or an inability to confirm placement is NOT a finding. Write only a benign marker (never a real web shell) and avoid overwriting live files unless ROE permits and you can do it non-destructively. You need both an archive-processing feature and a way to verify out-of-directory placement.