# DDEV incomplete tar symlink traversal fix allows host file overwrite - Incomplete fix of CVE-2026-32885

DDEV's incomplete ZipSlip fix rebases absolute symlink targets into dest for validation but writes the raw target, letting a malicious tar plant a host-absolute symlink and overwrite host files like ~/.zshrc for RCE.

- Payout: Research
- Severity: high
- Program: DDEV
- Found by: arpitjain099
- Disclosed: 2026-11-09
- CVE: CVE-2026-108262
- Write-up quality: 8/10
- Original: https://github.com/advisories/GHSA-9hq4-hm3j-jmph
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-9hq4-hm3j-jmph
- Tags: area:oss domain:oss impact:integrity impact:rce kind:research platform:ghsa sev:high tech:go tech:linux technique:incomplete-fix technique:source-review vuln:file-upload vuln:path-traversal

**Target:** Go tar extraction routine (pkg/archive/archive.go Untar) reached via ddev add-on get / import-db / import-files
**Root cause:** The symlink escape check rebases an absolute Linkname into dest via filepath.Join(dest, file.Linkname), which stays lexically inside dest and passes, while os.Symlink is called with the raw absolute Linkname, so the validated value differs from the written value. A following regular-file entry traversing the planted link passes the purely lexical path check and os.Create follows the symlink outside dest.
**Steps:**
1. Craft a tar with a symlink entry whose Linkname is absolute, e.g. `/Users/victim`, named `link`.
2. Add a second regular-file entry named `link/.zshrc` containing the attacker payload.
3. Deliver the archive to the victim via `ddev add-on get <repo|url>` (or `ddev import-db` / `import-files`).
4. Untar processes the symlink: line 298 computes `filepath.Join(dest, "/Users/victim")` = `dest/Users/victim`, the line 302 prefix check passes, and line 310 runs `os.Symlink(file.Linkname, fullPath)` creating `dest/link` -> `/Users/victim`.
5. Untar processes `link/.zshrc`: its fullPath is lexically inside dest so the line-238 check passes, then `os.Create` follows the symlink and overwrites `/Users/victim/.zshrc` on the host.
**How found:** Reviewed the CVE-2026-32885 fix commit and noticed the new symlink-target check rebases absolute targets into dest before validating, while the symlink creation uses the raw Linkname — a check-one-value/write-another divergence. Confirmed the lexical line-238 file check does not resolve symlinks, then built a tar with an absolute symlink plus a traversing file entry and drove the real Untar in a Go test with negative controls (relative ../ symlink and plain ../ file entry both correctly rejected).
**Exploitation:** Attacker publishes or hosts a malicious DDEV add-on repo/URL (or a crafted DB/files archive) containing an absolute-symlink entry plus a follow-up file entry that traverses it. When the victim runs `ddev add-on get`, Untar plants a host-absolute symlink inside dest and then writes through it, overwriting arbitrary host files such as shell rc-files, git hooks or cron entries, yielding code execution as the victim user.
**Escalation:** Overwriting a shell rc-file, git hook or cron entry converts arbitrary host file overwrite into code execution in the developer's user context.
**Insight:** When auditing a symlink/path containment fix, compare the exact value validated against the value passed to the syscall (os.Symlink/os.Create): rebasing via filepath.Join(dest, abs) silently neutralizes absolute-target checks, and lexical prefix checks on entry names never resolve previously-planted links — test absolute Linkname plus a follow-up traversing entry as a distinct case from relative ../ escapes.

## Proof of concept (copied exactly from the original report)

**Vulnerable absolute-symlink check and raw os.Symlink**

```
if filepath.IsAbs(file.Linkname) {
    resolvedTarget = filepath.Join(dest, file.Linkname)   // line 298: absolute target REBASED into dest
} else {
    resolvedTarget = filepath.Join(fullPathDir, file.Linkname)
}
if !strings.HasPrefix(filepath.Clean(resolvedTarget)+sep, filepath.Clean(dest)+sep) {  // line 302
    return ...escapes destination...                       // line 303
}
_ = os.Remove(fullPath)                                     // line 307
err = os.Symlink(file.Linkname, fullPath)                  // line 310: writes the RAW Linkname
```

