---
id: CVE-2026-43965
title: >-
  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 a…
summary: >-
  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 a…
severity: medium
cvss: 5.6
cvssVector: 'CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'
cwe:
  - CWE-22
vendor: Gleam
product: gleam
affected:
  - gleam >= 0.18.0-rc1 < 1.17.0
  - gleam-lang/gleam >= 0.18.0-rc1 < 1.17.0
  - >-
    gleam-lang/gleam >= ed7aec0484f10d60978b63788c8a6497590855ab <
    690ca069817bee5f77a28fc3e360627c1da19291
  - gleam-lang/gleam >= v0.18.0-rc1-elixir < v1.17.0-elixir
  - gleam-lang/gleam >= v0.18.0-rc1-erlang < v1.17.0-erlang
  - gleam-lang/gleam >= v0.18.0-rc1-node < v1.17.0-node
  - gleam-lang/gleam >= v0.18.0-rc1-node-slim < v1.17.0-node-slim
  - gleam-lang/gleam >= v0.18.0-rc1-elixir-slim < v1.17.0-elixir-slim
  - gleam-lang/gleam >= v0.18.0-rc1-erlang-slim < v1.17.0-erlang-slim
  - gleam-lang/gleam >= v0.18.0-rc1-erlang-alpine < v1.17.0-erlang-alpine
  - gleam-lang/gleam >= v0.18.0-rc1-elixir-alpine < v1.17.0-elixir-alpine
  - gleam-lang/gleam >= v0.18.0-rc1-node-alpine < v1.17.0-node-alpine
  - gleam-lang/gleam >= v0.18.0-rc1-scratch < v1.17.0-scratch
published: '2026-06-02'
updated: '2026-09-08'
sourceUpdated: '2026-09-08T01:17:30.670'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-43965'
references:
  - url: 'https://cna.erlef.org/cves/CVE-2026-43965.html'
    label: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
  - url: >-
      https://github.com/gleam-lang/gleam/commit/690ca069817bee5f77a28fc3e360627c1da19291
    label: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
  - url: >-
      https://github.com/gleam-lang/gleam/security/advisories/GHSA-jqvf-f6p2-wrv3
    label: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
  - url: 'https://osv.dev/vulnerability/EEF-CVE-2026-43965'
    label: 6b3ad84c-e1a6-4bf7-a703-f496b71e49db
  - url: >-
      https://github.com/gleam-lang/gleam/security/advisories/GHSA-jqvf-f6p2-wrv3
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
tags:
  - nvd
  - cve.org
  - exploit-available
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-06-02T15:07:44.667204Z'
cvssSource: cna
epss: 0.00229
epssPercentile: 0.13956
ingestedAt: '2026-09-08T13:33:24.844Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
