/

CVE-2026-27800

Severity:

HIGH RISK

(7.4)

Path Traversal / Zip Slip in Zed Extension Archive

CVE-2026-27800

Analyzed

Vulnerability type

Category:

Path Traversal / Zip Slip

CWE:

CWE-22

Impact:

Arbitrary File Write Outside Sandbox

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A Zip Slip style path traversal vulnerability in Zed's extension archive extraction allows crafted ZIP files to write files outside the intended sandbox directory.

A malicious or compromised extension that can supply a ZIP archive may escape its designated directory and overwrite arbitrary files accessible to the Zed process.

Affected context

The vulnerability occurs in Zed's extension handling pipeline, specifically when downloading and extracting extension ZIP archives using the extract_zip() function in crates/util/src/archive.rs.

It applies when Zed processes ZIP files that are not fully trusted and extracts them into a sandbox directory without validating entry paths for traversal sequences like ../ or absolute paths.

The risk is present in environments where Zed runs with permissions to write to sensitive locations beyond the extension directory.

Exploit preconditions

  • Attack surface: Extension ZIP archive extraction mechanism.
  • Required access: Ability to cause Zed to download or load a crafted extension ZIP (e.g., publishing a malicious extension, compromising an extension distribution source, or manipulating extension URLs).
  • Trigger point: Zed invokes extract_zip() on the attacker-controlled ZIP file during extension installation or update.
  • Why exploitation is possible: The extraction routine does not normalize and validate ZIP entry filenames before writing them to disk, allowing ../ or similar sequences to traverse out of the target extraction directory.

Why this happens

This issue stems from insufficient validation of file paths contained within ZIP archives during extraction.

The extract_zip() function trusts the file names recorded in the archive and directly concatenates them with the target directory, without canonicalization or checks to enforce that resulting paths remain inside the intended sandbox.

Conceptually, this is a classic CWE-22: Path Traversal pattern in the specific form known as Zip Slip, where untrusted archive metadata is used to construct filesystem paths, enabling writes outside the designated directory.

Potential impact

  • Malicious extensions could write files outside their sandboxed directory.
  • Overwriting of user configuration or application files that Zed can access.
  • Planting of malicious scripts or binaries in locations writable by the Zed process.
  • Assisting in privilege escalation or persistence when combined with other weaknesses (e.g., auto-loaded configuration, plugins, or startup scripts).
  • Integrity impact on project source code if the process has write access to workspace files.

General mitigation guidance

Effective mitigation focuses on enforcing robust path safety during archive extraction and constraining the impact of untrusted extensions:

  • Normalize and canonicalize each ZIP entry path before writing, then verify it is strictly contained within the intended extraction directory (e.g., via prefix checks on canonical paths).
  • Explicitly reject entries containing .., absolute paths, or platform-specific path tricks (such as leading separators or drive letters).
  • Enforce a tight allowlist of acceptable paths and file types within extension archives.
  • Apply least-privilege principles so the editor process and its extension handling cannot write to highly sensitive system locations.
  • Treat extension archives as untrusted input and isolate their handling where possible (e.g., via sandboxing or separate processes with restricted filesystem permissions).

How teams detect issues like this

Detection can focus on both code-level patterns and runtime behavior:

  • Static analysis / code scanning: Identify archive extraction code that:
  • Uses ZIP entry names directly when constructing filesystem paths.
  • Lacks canonicalization and containment checks against a base directory.
  • Does not explicitly reject .., absolute paths, or unusual path prefixes.
  • Code review signals:
  • Manual reviewers should look for file extraction loops that do not validate or normalize paths.
  • Check that any path-joining function is followed by safe containment checks.
  • Policy enforcement:
  • Enforce development guidelines requiring safe archive extraction helpers and banning ad-hoc extraction logic.
  • Integrate security linters or SAST tools into CI pipelines to flag path traversal patterns.
  • Runtime monitoring (where applicable):
  • Monitor for extension installation events resulting in file writes outside expected extension directories, if the platform and environment provide sufficient auditing.

Sources

SourceLink
github.comgithub.com/zed-industries/zed/security/advisories/GHSA-v385-xh3h-rrfr

Frequently asked

questions

It can be exploitable remotely if an attacker can cause Zed to download and install a crafted extension ZIP from a remote source, such as a malicious extension repository entry or a compromised distribution channel. The vulnerability is triggered during ZIP extraction, not simply by network access alone.

The attacker needs the ability to provide or influence the ZIP archive processed by Zed's extension extraction logic. This may involve publishing a malicious extension, compromising an existing extension, or otherwise directing Zed to an attacker-controlled archive. They do not necessarily need local shell access to the victim machine.

The most robust fix is to treat ZIP entry names as untrusted, canonicalize the combined base-plus-entry path, and then verify that the result is still inside the target extraction directory before writing. Any entries that fail this containment check, or that contain suspicious constructs like .. or absolute paths, should be rejected.

To prevent similar vulnerabilities, adopt a standard, well-audited archive extraction utility within the codebase, mandate path canonicalization and containment checks for any filesystem writes derived from untrusted input, and integrate static analysis or code review checklists that specifically call out Zip Slip and path traversal patterns as items to verify.

Find out what's already
exploitable in your codebase.