Executive brief
Gleam is a programming language that targets the Erlang runtime. A vulnerability in its package publishing tool allows an attacker with write access to a project repository to trick the system into including sensitive local files (such as SSH keys or cloud credentials) in the final package. When a developer or automated system publishes the package, these private files are uploaded to the public Hex package registry, potentially exposing them to anyone on the internet.
Technical details
The Gleam compiler's file collection helpers (gleam_files, native_files, and private_files) in 'compiler-cli/src/fs.rs' were configured to follow symbolic links when walking directories like 'src/' and 'priv/'. Because the 'add_path_to_tar' function in 'compiler-cli/src/publish.rs' failed to verify that the resolved target of these symlinks remained within the project root, it would include the contents of the linked files in the resulting Hex package. An attacker with repository write access can plant a symlink pointing to sensitive system files (e.g., ~/.ssh/id_rsa). When a maintainer or CI/CD pipeline runs 'gleam publish', those files are exfiltrated into the public artifact. This issue is fixed in Gleam version 1.17.0.
Affected products
- Gleam Gleam 0.10.0-rc1 to 1.17.0
Timeline
- 2026-06-02: disclosed
- 2026-06-02: advisory
- 2026-06-02: patched: Fixed in version 1.17.0