CVE-2026-43965
Path Traversal in build/packages/packages.toml Allows Arbitrary Directory Deletion
Description
Path traversal vulnerability in Gleam's dependency management allows arbitrary directory deletion via malicious build/packages/packages.toml content. Package keys read from build/packages/packages.toml by LocalPackages::read_from_disc are passed without validation to paths.build_packages_package(), which constructs a filesystem path by joining the project build directory with the attacker-controlled key. The resulting path is then passed to fs::delete_directory (which calls remove_dir_all). No check is performed to ensure the path remains within the intended build/packages/ directory. Both absolute paths and relative traversal sequences (e.g. ../) are accepted as package keys, allowing deletion of arbitrary directories. An attacker who can cause a victim to run gleam deps download on a project containing a malicious build/packages/packages.toml (e.g. by committing the normally-gitignored file to a repository) can cause arbitrary directories on the victim's system to be recursively deleted. This issue affects Gleam from 0.18.0-rc1 until 1.17.0.
INFO
Published Date :
June 2, 2026, 2:16 p.m.
Last Modified :
July 22, 2026, 7:10 p.m.
Remotely Exploit :
No
Source :
6b3ad84c-e1a6-4bf7-a703-f496b71e49db
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS | 134c704f-9b21-4f2e-91b3-4a467353bcc0 | |||||
| CVSS 4.0 | MEDIUM | 6b3ad84c-e1a6-4bf7-a703-f496b71e49db | ||||
| CVSS 4.0 | MEDIUM | 6b3ad84c-e1a6-4bf7-a703-f496b71e49db |
Solution
- Update Gleam to version 1.17.0 or later.
- Ensure build/packages/packages.toml content is validated.
- Remove malicious build/packages/packages.toml if present.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-43965.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-43965 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-43965
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-43965 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-43965 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Translated by [email protected]
Jul. 22, 2026
Action Type Old Value New Value Added Translation Title: Gleam de Gleam, Description: Una vulnerabilidad de salto de ruta en la gestión de dependencias de Gleam permite la eliminación arbitraria de directorios a través de contenido malicioso en build/packages/packages.toml. Las claves de paquete leídas de build/packages/packages.toml por LocalPackages::read_from_disc se pasan sin validación a paths.build_packages_package(), que construye una ruta del sistema de archivos uniendo el directorio de compilación del proyecto con la clave controlada por el atacante. La ruta resultante se pasa luego a fs::delete_directory (que llama a remove_dir_all). No se realiza ninguna comprobación para asegurar que la ruta permanezca dentro del directorio build/packages/ previsto. Tanto las rutas absolutas como las secuencias de salto relativas (p. ej., ../) se aceptan como claves de paquete, permitiendo la eliminación de directorios arbitrarios. Un atacante que puede hacer que una víctima ejecute gleam deps download en un proyecto que contenga un build/packages/packages.toml malicioso (p. ej., al confirmar el archivo normalmente ignorado por Git en un repositorio) puede hacer que se eliminen recursivamente directorios arbitrarios en el sistema de la víctima. Este problema afecta a Gleam desde la versión 0.18.0-rc1 hasta la 1.17.0. -
CVE Modified by 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
Jun. 17, 2026
Action Type Old Value New Value Added Affected [{'cpes': ['cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*'], 'vendor': 'Gleam', 'modules': ['compiler-cli'], 'product': 'Gleam', 'versions': [{'status': 'affected', 'version': '0.18.0-rc1', 'lessThan': '1.17.0', 'versionType': 'semver'}], 'packageURL': 'pkg:sid/gleam.run/gleam', 'packageName': 'gleam', 'programFiles': ['compiler-cli/src/dependencies.rs'], 'defaultStatus': 'unaffected', 'programRoutines': [{'name': 'compiler_cli::dependencies::remove_extra_packages'}, {'name': 'compiler_cli::dependencies::LocalPackages::read_from_disc'}, {'name': 'compiler_cli::dependencies::LocalPackages::extra_local_packages'}]}, {'cpes': ['cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*'], 'repo': 'https://github.com/gleam-lang/gleam', 'vendor': 'Gleam', 'modules': ['compiler-cli'], 'product': 'Gleam', 'versions': [{'status': 'affected', 'version': '0.18.0-rc1', 'lessThan': '1.17.0', 'versionType': 'semver'}, {'status': 'affected', 'version': 'ed7aec0484f10d60978b63788c8a6497590855ab', 'lessThan': '690ca069817bee5f77a28fc3e360627c1da19291', 'versionType': 'git'}], 'packageURL': 'pkg:github/gleam-lang/gleam', 'packageName': 'gleam-lang/gleam', 'programFiles': ['compiler-cli/src/dependencies.rs'], 'collectionURL': 'https://github.com', 'defaultStatus': 'unaffected', 'programRoutines': [{'name': 'compiler_cli::dependencies::remove_extra_packages'}, {'name': 'compiler_cli::dependencies::LocalPackages::read_from_disc'}, {'name': 'compiler_cli::dependencies::LocalPackages::extra_local_packages'}]}, {'cpes': ['cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*'], 'vendor': 'Gleam', 'modules': ['compiler-cli'], 'product': 'Gleam', 'versions': [{'status': 'affected', 'version': 'v0.18.0-rc1-elixir', 'lessThan': 'v1.17.0-elixir', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-erlang', 'lessThan': 'v1.17.0-erlang', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-node', 'lessThan': 'v1.17.0-node', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-node-slim', 'lessThan': 'v1.17.0-node-slim', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-elixir-slim', 'lessThan': 'v1.17.0-elixir-slim', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-erlang-slim', 'lessThan': 'v1.17.0-erlang-slim', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-erlang-alpine', 'lessThan': 'v1.17.0-erlang-alpine', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-elixir-alpine', 'lessThan': 'v1.17.0-elixir-alpine', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-node-alpine', 'lessThan': 'v1.17.0-node-alpine', 'versionType': 'other'}, {'status': 'affected', 'version': 'v0.18.0-rc1-scratch', 'lessThan': 'v1.17.0-scratch', 'versionType': 'other'}], 'packageURL': 'pkg:oci/gleam?repository_url=ghcr.io/gleam-lang', 'packageName': 'gleam-lang/gleam', 'programFiles': ['compiler-cli/src/dependencies.rs'], 'collectionURL': 'https://ghcr.io', 'defaultStatus': 'unaffected', 'programRoutines': [{'name': 'compiler_cli::dependencies::remove_extra_packages'}, {'name': 'compiler_cli::dependencies::LocalPackages::read_from_disc'}, {'name': 'compiler_cli::dependencies::LocalPackages::extra_local_packages'}]}] -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Jun. 17, 2026
Action Type Old Value New Value Added SSVC {'id': 'CVE-2026-43965', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'poc'}, {'automatable': 'no'}, {'technicalImpact': 'partial'}], 'version': '2.0.3', 'timestamp': '2026-06-02T15:07:44.667204Z'} -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Jun. 02, 2026
Action Type Old Value New Value Added Reference https://github.com/gleam-lang/gleam/security/advisories/GHSA-jqvf-f6p2-wrv3 -
New CVE Received by 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
Jun. 02, 2026
Action Type Old Value New Value Added Description Path traversal vulnerability in Gleam's dependency management allows arbitrary directory deletion via malicious build/packages/packages.toml content. Package keys read from build/packages/packages.toml by LocalPackages::read_from_disc are passed without validation to paths.build_packages_package(), which constructs a filesystem path by joining the project build directory with the attacker-controlled key. The resulting path is then passed to fs::delete_directory (which calls remove_dir_all). No check is performed to ensure the path remains within the intended build/packages/ directory. Both absolute paths and relative traversal sequences (e.g. ../) are accepted as package keys, allowing deletion of arbitrary directories. An attacker who can cause a victim to run gleam deps download on a project containing a malicious build/packages/packages.toml (e.g. by committing the normally-gitignored file to a repository) can cause arbitrary directories on the victim's system to be recursively deleted. This issue affects Gleam from 0.18.0-rc1 until 1.17.0. Added CVSS V4.0 AV:L/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X Added CWE CWE-22 Added Reference https://cna.erlef.org/cves/CVE-2026-43965.html Added Reference https://github.com/gleam-lang/gleam/commit/690ca069817bee5f77a28fc3e360627c1da19291 Added Reference https://github.com/gleam-lang/gleam/security/advisories/GHSA-jqvf-f6p2-wrv3 Added Reference https://osv.dev/vulnerability/EEF-CVE-2026-43965