Description
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 before 1.17.0.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Gleam | Gleam | 1.16.0 – < 1.17.0, v1.16.0-elixir – < v1.17.0-elixir, v1.16.0-erlang – < v1.17.0-erlang, v1.16.0-node – < v1.17.0-node, v1.16.0-node-slim – < v1.17.0-node-slim, v1.16.0-elixir-slim – < v1.17.0-elixir-slim, v1.16.0-erlang-slim – < v1.17.0-erlang-slim, v1.16.0-erlang-alpine – < v1.17.0-erlang-alpine,… | 1.17.0 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | gleam | 1.17.0-1.1 | openSUSE-SU-2026:10953-1 |
| openSUSE Leap 16.0 | gleam | 1.17.0-bp160.1.1 | openSUSE-SU-2026:21143-1 |
Advisories 2
- openSUSE-SU-2026:21143-1 Security update for gleam SUSE / openSUSE Security Updates · Jun 30, 2026
- openSUSE-SU-2026:10953-1 gleam-1.17.0-1.1 on GA media SUSE / openSUSE Security Updates · Jun 5, 2026
References
- Path traversal and arbitrary file read in `gleam docs build` via `documentation.pages` vendor-advisory related
- EEF CNA record for CVE-2026-32685 related
- OSV record EEF-CVE-2026-32685 related
- Restrict documentation page path handling patch
- Introducing commit 61ed8de in gleam-lang/gleam related
- Fix commit 8157061 in gleam-lang/gleam patch