/

CVE-2026-43888

Severity:

HIGH RISK

(8.7)

Path Traversal in Outline ZipHelper.extract

CVE-2026-43888

Deferred

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write Outside Extraction Sandbox

Severity:

HIGH RISK

(8.7)

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 path handling flaw in Outline's ZIP extraction logic can cause files to be written outside the intended sandbox directory when ZIP entries have very long nested paths.

By crafting ZIP entries that exceed the maximum path length, an attacker can cause extracted files to be created relative to the application's working directory, potentially overwriting or planting files in unintended locations.

Affected context

This issue appears in Outline deployments that:

  • Allow users to import content via ZIP archives
  • Rely on ZipHelper.extract to unpack uploaded ZIP files
  • Run on systems where the joined extraction path can exceed the application's MAX_PATH_LENGTH (4096 bytes)

The vulnerability is tied to how long nested paths inside ZIP archives are normalized and truncated before creating files on disk, and how cleanup only targets the temporary extraction directory, not the broader working directory.

Exploit preconditions

  • Attack surface: ZIP import functionality exposed through the Outline application (typically via web UI or API).
  • Required access: Ability to upload or otherwise supply a ZIP archive to the Outline instance.
  • Trigger point: Processing of a crafted ZIP archive where at least one entry's nested path is long enough that the full extraction path exceeds MAX_PATH_LENGTH (4096 bytes).
  • Why exploitation is possible: When the computed filesystem path exceeds the length limit, the helper trimFileAndExt, which uses path.basename, silently discards directory components and returns only a filename. fs.createWriteStream then creates the file relative to the process working directory instead of inside the extraction sandbox, and cleanup only removes the designated temporary directory, leaving the escaped file behind.

Why this happens

The core issue is an unsafe path normalization and truncation pattern in the ZIP extraction pipeline.

ZipHelper.extract computes a full path for each ZIP entry under a designated extraction directory and then passes that path through trimFileAndExt to enforce a maximum length constraint. trimFileAndExt uses path.basename on the full path when truncating, effectively stripping all directory components and returning only the filename when the length limit is exceeded.

This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because the code assumes that any path manipulation still preserves the extraction sandbox prefix. In reality, truncation breaks this assumption, and the subsequent call to fs.createWriteStream operates on a bare filename relative to the process working directory, allowing file creation outside the intended restricted directory.

Potential impact

  • Creation of attacker-controlled files in the Outline process working directory.
  • Overwriting of existing files that share the truncated filename in the working directory (subject to filesystem permissions).
  • Potential modification of application configuration, log, or auxiliary files if they are located in or under the working directory and share the targeted filename.
  • Planting of files that may later be executed or served by other components, depending on deployment layout and server configuration.
  • Persistence of extracted, attacker-controlled files beyond normal import cleanup, increasing the window of exposure.

General mitigation guidance

Mitigation should focus on enforcing strict directory confinement and safe path handling during archive extraction.

Useful defensive patterns include:

  • Ensuring that any truncation or normalization logic operates only on filenames, not on full paths that include directory components, so that sandbox prefixes are never removed.
  • Verifying after all path transformations that the final extraction path still resides within the intended extraction root (e.g., by resolving to an absolute path and checking the prefix).
  • Rejecting ZIP entries with paths that exceed conservative length limits instead of silently truncating them.
  • Treating all archive-supplied paths as untrusted and applying robust sanitization and validation rules, including checks against absolute paths, parent directory (..) segments, and other path traversal tokens.
  • Running the extraction process with the least necessary filesystem privileges, ideally inside a dedicated directory isolated from configuration, executables, and other sensitive assets.

How teams detect issues like this

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

  • Static analysis & code review:
  • Flag uses of generic filesystem APIs where user-controlled or archive-derived paths are passed to fs.createWriteStream, fs.writeFile, or similar functions without explicit confinement checks.
  • Identify helper functions that manipulate full paths for length or formatting and then re-use them as filesystem paths, especially when they call path.basename or strip directory components.
  • Verify that every archive extraction path is validated post-normalization to ensure it remains within the intended sandbox directory.
  • Policy and tooling:
  • Add CI rules that disallow silent truncation of untrusted paths and require explicit handling (e.g., reject or log) when limits are reached.
  • Employ security-focused linters or SAST tools configured with rules for path traversal and unsafe archive extraction patterns.
  • Operational monitoring:
  • Monitor for unexpected file creation or modification events in the Outline working directory and surrounding paths, especially following ZIP imports.
  • Enable logging around archive extraction routines to capture anomalous or excessively long entry names for later review.

Sources

SourceLink
github.comgithub.com/outline/outline/security/advisories/GHSA-hw32-2v7j-mgqc

Frequently asked

questions

Yes, in typical deployments where Outline exposes ZIP import functionality over HTTP, a remote attacker who can reach the application and upload ZIP files can attempt to exploit this issue by providing a specially crafted archive.

The attacker needs the ability to supply a ZIP file to the Outline instance—usually via an authenticated import feature. The exact access level depends on how the import endpoint is permissioned, but no direct filesystem access is required.

The safest fix is to enforce strict directory confinement for all archive extraction paths: sanitize and normalize entry paths, reject entries that cannot be safely mapped under a specific extraction root, avoid truncating full paths in ways that remove sandbox prefixes, and ensure that any length enforcement happens on trusted components (such as filenames) rather than full untrusted paths.

Future code handling archives or filesystem paths should treat all path components as untrusted, avoid ad hoc path manipulation, and always verify that computed paths resolve inside a designated directory before file creation. Complement this with code review practices, static analysis rules targeting path traversal, and security guidelines that discourage silent truncation or normalization of untrusted paths without explicit safety checks.

Find out what's already
exploitable in your codebase.