{"id":"CVE-2026-42795","aliases":["CVE-2026-42795","EEF-CVE-2026-42795","GHSA-qhh5-fg4c-8gqc"],"related":[],"kind":"vulnerability","state":"published","title":"Symlink Following in Hex Package Export Allows Embedding Files Outside Project Root","summary":"Symlink following vulnerability in Gleam's Hex package export allows files outside the project root to be embedded in the generated package tarball.\n\nThe file collection helpers (gleam_files, native_files, private_files) in compiler-cli/src/fs.rs use follow_links(true) when walking publishable directories such as src/ and priv/. The collected paths are added to the package archive via add_path_to_tar in compiler-cli/src/publish.rs without verifying that the resolved target remains within the project root. A symlink placed under a publishable directory will cause gleam export hex-tarball or gleam publish to embed the contents of the symlink target into the generated Hex package.\n\nAn attacker with write access to the project repository can place a symlink in src/ or priv/ pointing to an arbitrary file. When a maintainer or CI pipeline runs gleam publish or gleam export hex-tarball, local files readable by the publisher (such as secrets, tokens, or SSH keys) are silently embedded into the published package artifact.\n\nThis issue affects gleam: from 0.10.0-rc1 before 1.17.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Symlink following vulnerability in Gleam's Hex package export allows files outside the project root to be embedded in the generated package tarball.\n\nThe file collection helpers (gleam_files, native_files, private_files) in compiler-cli/src/fs.rs use follow_links(true) when walking publishable directories such as src/ and priv/. The collected paths are added to the package archive via add_path_to_tar in compiler-cli/src/publish.rs without verifying that the resolved target remains within the project root. A symlink placed under a publishable directory will cause gleam export hex-tarball or gleam publish to embed the contents of the symlink target into the generated Hex package.\n\nAn attacker with write access to the project repository can place a symlink in src/ or priv/ pointing to an arbitrary file. When a maintainer or CI pipeline runs gleam publish or gleam export hex-tarball, local files readable by the publisher (such as secrets, tokens, or SSH keys) are silently embedded into the published package artifact.\n\nThis issue affects gleam: from 0.10.0-rc1 before 1.17.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nSymlink following vulnerability in Gleam's Hex package export allows files outside the project root to be embedded in the generated package tarball.\n\nThe file collection helpers (`gleam_files`, `native_files`, `private_files`) in `compiler-cli/src/fs.rs` use `follow_links(true)` when walking publishable directories such as `src/` and `priv/`. The collected paths are added to the package archive via `add_path_to_tar` in `compiler-cli/src/publish.rs` without verifying that the resolved target remains within the project root. A symlink placed under a publishable directory will cause `gleam export hex-tarball` or `gleam publish` to embed the contents of the symlink target into the generated Hex package.\n\nAn attacker with write access to the project repository can place a symlink in `src/` or `priv/` pointing to an arbitrary file. When a maintainer or CI pipeline runs `gleam publish` or `gleam export hex-tarball`, local files readable by the publisher (such as secrets, tokens, or SSH keys) are silently embedded into the published package artifact.\n\nThis issue affects gleam: from 0.10.0-rc1 before 1.17.0.\n\n## Workarounds\n\n* Avoid running `gleam publish` or `gleam export hex-tarball` on untrusted projects\n* Review the contents of `src/` and `priv/` for unexpected symlinks before publishing\n* Run publishing commands in a restricted or isolated environment (e.g. containers)","format":"markdown","source":"eef"},{"lang":"es","text":"Una vulnerabilidad de seguimiento de enlaces simbólicos en la exportación de paquetes Hex de Gleam permite que archivos fuera de la raíz del proyecto sean incrustados en el tarball del paquete generado.\n\nLos ayudantes de recolección de archivos (gleam_files, native_files, private_files) en compiler-cli/src/fs.rs usan follow_links(true) al recorrer directorios publicables como src/ y priv/. Las rutas recolectadas se añaden al archivo del paquete a través de add_path_to_tar en compiler-cli/src/publish.rs sin verificar que el objetivo resuelto permanezca dentro de la raíz del proyecto. Un enlace simbólico colocado bajo un directorio publicable hará que gleam export hex-tarball o gleam publish incrusten el contenido del objetivo del enlace simbólico en el paquete Hex generado.\n\nUn atacante con acceso de escritura al repositorio del proyecto puede colocar un enlace simbólico en src/ o priv/ apuntando a un archivo arbitrario. Cuando un mantenedor o una tubería de CI ejecuta gleam publish o gleam export hex-tarball, los archivos locales legibles por el publicador (como secretos, tokens o claves SSH) son incrustados silenciosamente en el artefacto del paquete publicado.\n\nEste problema afecta a Gleam desde 0.10.0-rc1 hasta 1.17.0.","source":"nvd"}],"published":"2026-06-02T13:41:39.527Z","modified":"2026-11-25T06:30:22.898Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.1,"rating":"MEDIUM"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.1,"rating":"MEDIUM"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"}],"cwes":["CWE-59"],"affected":[{"ranges":[{"type":"other","introduced":"v0.10.0-rc1-elixir","fixed":"v1.17.0-elixir","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-erlang","fixed":"v1.17.0-erlang","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-node","fixed":"v1.17.0-node","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-node-slim","fixed":"v1.17.0-node-slim","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-elixir-slim","fixed":"v1.17.0-elixir-slim","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-erlang-slim","fixed":"v1.17.0-erlang-slim","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-erlang-alpine","fixed":"v1.17.0-erlang-alpine","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-elixir-alpine","fixed":"v1.17.0-elixir-alpine","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-node-alpine","fixed":"v1.17.0-node-alpine","status":"affected"},{"type":"other","introduced":"v0.10.0-rc1-scratch","fixed":"v1.17.0-scratch","status":"affected"}],"vendor":"Gleam","product":"Gleam","package":"gleam-lang/gleam","cpe":"cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.10.0-rc1","fixed":"1.17.0","status":"affected"}],"vendor":"Gleam","product":"Gleam","package":"gleam","cpe":"cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"git","introduced":"c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c","fixed":"6435a5528b9ae0449e2f32be579641ec485f6866","status":"affected"}],"vendor":"Gleam","product":"Gleam","package":"gleam-lang/gleam","cpe":"cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*","repo":"https://github.com/gleam-lang/gleam","source":"cvelist"},{"ranges":[{"type":"git","introduced":"c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c","status":"affected","fixed":"6435a5528b9ae0449e2f32be579641ec485f6866"}],"repo":"https://github.com/gleam-lang/gleam","source":"eef"}],"references":[{"url":"https://github.com/gleam-lang/gleam/security/advisories/GHSA-qhh5-fg4c-8gqc","tags":["advisory","exploit","related","vendor-advisory"],"sources":["cvelist","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-42795.html","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-42795","tags":["related"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gleam-lang/gleam/commit/c82a2d83bd0c06cafdc196820deb3f89a9b3ff7c","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/gleam-lang/gleam/commit/6435a5528b9ae0449e2f32be579641ec485f6866","tags":["fix","patch"],"sources":["cvelist","eef","nvd"]}],"credits":["Abdelrahman Ahmed Aboelkasem (0x2face)","Aly (spect3r1)","Jonatan Männchen / EEF","Louis Pilfold"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-06-02T15:04:06.195Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42795","url":"https://www.cve.org/CVERecord?id=CVE-2026-42795","licence":"CVE Terms of Use","modified":"2026-11-20T05:59:25.827Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-42795","url":"https://osv.dev/vulnerability/EEF-CVE-2026-42795","licence":"CC-BY-4.0","modified":"2026-11-25T06:30:22.898Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42795","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42795","licence":"Public domain","modified":"2026-11-20T06:17:27.530Z"}],"updatedAt":"2026-11-25T22:59:23.563Z","epss":{"score":0.00244,"percentile":0.1674,"date":"2026-12-01T12:00:22.000Z"}}