CVE-2026-32685 PUBLISHED

Path Traversal in gleam docs build via documentation.pages Allows Arbitrary File Read and Write

Assigner: EEF
Reserved: 13.03.2026 Published: 02.06.2026 Updated: 02.06.2026

Path traversal vulnerability in Gleam's handling of custom documentation pages allows arbitrary file read and file write outside the intended documentation output directory.

The documentation.pages entries from gleam.toml are incorporated into filesystem paths without sufficient validation or confinement to the intended project and documentation output directories. The documentation.pages[].path field can be used to write generated documentation files outside the intended build/dev/docs/<package>/ output directory. The documentation.pages[].source field can be used to read files outside the project directory and embed their contents into generated documentation output.

An attacker who can convince a victim to run gleam docs build on an untrusted project, or with untrusted gleam.toml content, can cause local files readable by the victim to be included in generated documentation artifacts, and can cause generated documentation files to be written outside the intended docs output directory.

This issue affects Gleam from 1.16.0 until 1.17.0.

Metrics

CVSS Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
CVSS Score: 4.6

Product Status

Vendor Gleam
Product Gleam
Versions Default: unaffected
  • affected from 1.16.0 to 1.17.0 (excl.)
Vendor Gleam
Product Gleam
Versions Default: unaffected
  • affected from 1.16.0 to 1.17.0 (excl.)
  • affected from 61ed8deb6572b5591ad17d6302c1a38607522f16 to 81570611906b6b0039c948037094d09a68700f3a (excl.)
Vendor Gleam
Product Gleam
Versions Default: unaffected
  • affected from v1.16.0-elixir to v1.17.0-elixir (excl.)
  • affected from v1.16.0-erlang to v1.17.0-erlang (excl.)
  • affected from v1.16.0-node to v1.17.0-node (excl.)
  • affected from v1.16.0-node-slim to v1.17.0-node-slim (excl.)
  • affected from v1.16.0-elixir-slim to v1.17.0-elixir-slim (excl.)
  • affected from v1.16.0-erlang-slim to v1.17.0-erlang-slim (excl.)
  • affected from v1.16.0-erlang-alpine to v1.17.0-erlang-alpine (excl.)
  • affected from v1.16.0-elixir-alpine to v1.17.0-elixir-alpine (excl.)
  • affected from v1.16.0-node-alpine to v1.17.0-node-alpine (excl.)
  • affected from v1.16.0-scratch to v1.17.0-scratch (excl.)

Affected Configurations

The project must use custom documentation pages via documentation.pages in gleam.toml, and the victim must run gleam docs build on an untrusted project or with untrusted gleam.toml content. Projects that do not use custom documentation pages are not affected.

Workarounds

  • Avoid running gleam docs build on untrusted projects
  • Review documentation.pages entries in gleam.toml before generating documentation
  • Run documentation generation in a restricted or isolated environment (e.g. containers)

Credits

  • evipepota finder
  • evipepota remediation developer
  • Louis Pilfold remediation reviewer
  • Jonatan Männchen / EEF analyst

References

Problem Types

  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') CWE

Impacts

  • CAPEC-139 Relative Path Traversal
  • CAPEC-597 Absolute Path Traversal