/

CVE-2026-38600

Severity:

CRITICAL RISK

(9.8)

Path Traversal (CWE-22) in gohttpserver /upload Endpoint

CVE-2026-38600

Received

Vulnerability type

Category:

Zip Slip (Path Traversal)

CWE:

CWE-22

Impact:

Arbitrary File Write

Severity:

CRITICAL RISK

(9.8)

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 vulnerability in gohttpserver through v1.3.0 allows an attacker to write files outside the intended extraction directory by uploading a crafted ZIP archive to the /upload endpoint. The consequences depend on which files the server process can access and whether the endpoint is reachable under the deployment's access controls.

A Zip Slip vulnerability in gohttpserver through v1.3.0 allows an attacker to write files outside the intended extraction directory by uploading a crafted ZIP archive to the /upload endpoint. The consequences depend on which files the server process can access and whether the endpoint is reachable under the deployment's access controls.

Affected context

The issue affects gohttpserver through v1.3.0, in the handling of ZIP archives uploaded to the /upload endpoint. It becomes risky when the server extracts archive entries without ensuring their resolved paths remain within the intended destination directory. The practical impact depends on the server's filesystem permissions and deployment configuration.

The issue affects gohttpserver through v1.3.0, in the handling of ZIP archives uploaded to the /upload endpoint. It becomes risky when the server extracts archive entries without ensuring their resolved paths remain within the intended destination directory. The practical impact depends on the server's filesystem permissions and deployment configuration.

Exploit preconditions

  • Attack surface: The /upload endpoint must be reachable by the attacker.
  • Required access: The attacker must be able to submit an upload; authentication or other access controls may affect this.
  • Trigger point: The server processes and extracts a crafted ZIP archive.
  • Why exploitation is possible: Archive entry paths may escape the intended extraction directory if their resolved destinations are not safely constrained.
  • Attack surface: The /upload endpoint must be reachable by the attacker.
  • Required access: The attacker must be able to submit an upload; authentication or other access controls may affect this.
  • Trigger point: The server processes and extracts a crafted ZIP archive.
  • Why exploitation is possible: Archive entry paths may escape the intended extraction directory if their resolved destinations are not safely constrained.

Why this happens

The underlying bug is improper limitation of a pathname to a restricted directory, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. In a Zip Slip flaw, archive entry names are trusted without safely resolving and checking their destination paths before writing files. As a result, extraction may write outside the intended directory.

The underlying bug is improper limitation of a pathname to a restricted directory, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. In a Zip Slip flaw, archive entry names are trusted without safely resolving and checking their destination paths before writing files. As a result, extraction may write outside the intended directory.

Potential impact

  • An attacker could create or overwrite files accessible to the server process.
  • Application behavior or availability may be affected if important files are modified.
  • Depending on the files affected and runtime configuration, the issue could contribute to further compromise.
  • Sensitive data could be exposed or altered if accessible files are targeted.
  • An attacker could create or overwrite files accessible to the server process.
  • Application behavior or availability may be affected if important files are modified.
  • Depending on the files affected and runtime configuration, the issue could contribute to further compromise.
  • Sensitive data could be exposed or altered if accessible files are targeted.

General mitigation guidance

Defensive approaches focus on constraining archive extraction and reducing the trust placed in uploaded files:

  • Resolve each destination path and ensure it remains inside the intended extraction directory before writing.
  • Reject archive entries with absolute paths, traversal components, or otherwise unexpected names.
  • Prefer extraction APIs or libraries that enforce safe destination-path handling by default.
  • Validate archive structure and impose limits on file count, sizes, and nesting.
  • Store uploads and extracted content in isolated locations, and run the service with least-privilege filesystem access.

Defensive approaches focus on constraining archive extraction and reducing the trust placed in uploaded files:

  • Resolve each destination path and ensure it remains inside the intended extraction directory before writing.
  • Reject archive entries with absolute paths, traversal components, or otherwise unexpected names.
  • Prefer extraction APIs or libraries that enforce safe destination-path handling by default.
  • Validate archive structure and impose limits on file count, sizes, and nesting.
  • Store uploads and extracted content in isolated locations, and run the service with least-privilege filesystem access.

How teams detect issues like this

  • Use static analysis to identify archive extraction code that joins entry names to a destination without canonical-path containment checks.
  • Review upload handlers for validation of archive entry paths before files are created or overwritten.
  • Apply code-review checks and security policies requiring safe extraction APIs and isolated upload directories.
  • Monitor upload and extraction activity for rejected path traversal attempts or unexpected writes outside designated storage locations.
  • Use static analysis to identify archive extraction code that joins entry names to a destination without canonical-path containment checks.
  • Review upload handlers for validation of archive entry paths before files are created or overwritten.
  • Apply code-review checks and security policies requiring safe extraction APIs and isolated upload directories.
  • Monitor upload and extraction activity for rejected path traversal attempts or unexpected writes outside designated storage locations.

Sources

SourceLink
github.comgithub.com/Den-Sec/security-research/blob/master/advisories/gohttpserver/VDR-001-zipslip.md
github.comgithub.com/codeskyblue/gohttpserver
github.comgithub.com/codeskyblue/gohttpserver/issues/232
security.snyk.iosecurity.snyk.io/research/zip-slip-vulnerability

Frequently asked

questions

It may be exploitable by a user who can submit an archive to a reachable /upload endpoint. Actual exposure depends on network reachability and access controls.

The vulnerability description does not specify authentication requirements. Whether an attacker needs an account depends on how the endpoint is configured and protected.

Ensure every archive entry resolves to a destination within the designated extraction directory before writing, and reject entries that fail this check.

Use safe extraction APIs, validate archive paths and resource limits, isolate uploaded content, and limit the filesystem privileges of the service.

It may be exploitable by a user who can submit an archive to a reachable /upload endpoint. Actual exposure depends on network reachability and access controls.

The vulnerability description does not specify authentication requirements. Whether an attacker needs an account depends on how the endpoint is configured and protected.

Ensure every archive entry resolves to a destination within the designated extraction directory before writing, and reject entries that fail this check.

Use safe extraction APIs, validate archive paths and resource limits, isolate uploaded content, and limit the filesystem privileges of the service.

Find out what's already
exploitable in your codebase.