Skip to content
Heist/ feed
Back to feed
Medium

Path traversal in Gleam via unvalidated package application names

Type: advisorySources: OSV

## Summary Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in gleam-lang gleam allows a malicious package publisher to delete a directory outside the project's build directory when a developer builds a project. A Hex package release's metadata carries an `app` field with the release's OTP application name. Gleam reads this field from the hex.pm release API when it downloads dependencies and uses it as the package's build directory name without validating it (`hex_manifest_package` in `compiler-cli/src/dependencies.rs`, `ProjectPaths::build_directory_for_package`). When a dependency fails to compile, Gleam deletes that directory with `remove_dir_all`. hex.pm didn't restrict the field to a directory name before 2026-10-12, so a publisher could set it to a value such as `../../../../target` or an absolute path. When a project depends on such a release directly or transitively and the release fails to compile, `gleam build`, `gleam check`, `gleam run`, `gleam test` or `gleam export` deletes the directory the name resolves to. For a pure Gleam package no publisher code runs. This issue affects gleam: from 0.32.4 before 1.19.2. ## Details 1. `hex_manifest_package` (`compiler-cli/src/dependencies.rs`) sets the manifest package's `otp_app` to `meta.app` from `GET packages//releases/` without validation. hex.pm doesn't restrict this field to a directory name. The signed registry record's dependency `app` label is decoded but never used as a

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-103061
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 08:44 UTC · Revision 1

Source evidence

Path traversal in Gleam via unvalidated package application names

core-osv · Original source

Published 12 Oct 2026, 18:23 UTC

## Summary Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in gleam-lang gleam allows a malicious package publisher to delete a directory outside the project's build directory when a developer builds a project. A Hex package release's metadata carries an `app` field with the release's OTP application name. Gleam reads this field from the hex.pm release API when it downloads dependencies and uses it as the package's build directory name without validating it (`hex_manifest_package` in `compiler-cli/src/dependencies.rs`, `ProjectPaths::build_directory_for_package`). When a dependency fails to compile, Gleam deletes that directory with `remove_dir_all`. hex.pm didn't restrict the field to a directory name before 2026-10-12, so a publisher could set it to a value such as `../../../../target` or an absolute path. When a project depends on such a release directly or transitively and the release fails to compile, `gleam build`, `gleam check`, `gleam run`, `gleam test` or `gleam export` deletes the directory the name resolves to. For a pure Gleam package no publisher code runs. This issue affects gleam: from 0.32.4 before 1.19.2. ## Details 1. `hex_manifest_package` (`compiler-cli/src/dependencies.rs`) sets the manifest package's `otp_app` to `meta.app` from `GET packages//releases/` without validation. hex.pm doesn't restrict this field to a directory name. The signed registry record's dependency `app` label is decoded but never used as a

osv:EEF-CVE-2026-103061
Complete source record
{
  "id": "478cfa9e72d428c74d4938322a8a551aceb873b745f7da7311b62650994fa103",
  "url": "https://osv.dev/vulnerability/EEF-CVE-2026-103061",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Path traversal in Gleam via unvalidated package application names",
    "summary": "## Summary Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in gleam-lang gleam allows a malicious package publisher to delete a directory outside the project's build directory when a developer builds a project. A Hex package release's metadata carries an `app` field with the release's OTP application name. Gleam reads this field from the hex.pm release API when it downloads dependencies and uses it as the package's build directory name without validating it (`hex_manifest_package` in `compiler-cli/src/dependencies.rs`, `ProjectPaths::build_directory_for_package`). When a dependency fails to compile, Gleam deletes that directory with `remove_dir_all`. hex.pm didn't restrict the field to a directory name before 2026-10-12, so a publisher could set it to a value such as `../../../../target` or an absolute path. When a project depends on such a release directly or transitively and the release fails to compile, `gleam build`, `gleam check`, `gleam run`, `gleam test` or `gleam export` deletes the directory the name resolves to. For a pure Gleam package no publisher code runs. This issue affects gleam: from 0.32.4 before 1.19.2. ## Details 1. `hex_manifest_package` (`compiler-cli/src/dependencies.rs`) sets the manifest package's `otp_app` to `meta.app` from `GET packages//releases/` without validation. hex.pm doesn't restrict this field to a directory name. The signed registry record's dependency `app` label is decoded but never used as a",
    "evidence": "osv:EEF-CVE-2026-103061",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "EEF-CVE-2026-103061",
      "aliases": [
        "CVE-2026-103061",
        "EEF-CVE-2026-103061",
        "GHSA-jhcr-c7qm-8589"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/gleam-lang/gleam",
              "type": "GIT",
              "events": [
                {
                  "introduced": "d13f27ee80aae7a521d2e9433c4deaf53f892574"
                },
                {
                  "fixed": "d15c981fac6e533d70ac8ee89a6ef4dbf139adc3"
                },
                {
                  "fixed": "54bbb2b98af1505b6eed93c45b1936fc76412e5c"
                }
              ]
            }
          ],
          "versions": [
            "v1.19.1",
            "v1.19.0",
            "v1.19.0-rc3",
            "v1.19.0-rc2",
            "v1.19.0-rc1",
            "v1.18.0",
            "v1.18.0-rc2",
            "v1.18.0-rc1",
            "v1.17.0",
            "v1.17.0-rc2",
            "v1.17.0-rc1",
            "v1.16.0",
            "v1.16.0-rc4",
            "v1.16.0-rc3",
            "v1.16.0-rc2",
            "v1.16.0-rc1",
            "v1.15.1",
            "v1.15.0",
            "v1.15.0-rc2",
            "v1.15.0-rc1",
            "v1.14.0",
            "v1.14.0-rc3",
            "v1.14.0-rc2",
            "v1.14.0-rc1",
            "v1.13.0",
            "v1.13.0-rc2",
            "v1.13.0-rc1",
            "v1.12.0",
            "v1.12.0-rc3",
            "v1.12.0-rc2",
            "v1.12.0-rc1",
            "v1.11.1",
            "v1.11.0",
            "v1.11.0-rc2",
            "v1.11.0-rc1",
            "v1.10.0",
            "v1.10.0-rc1",
            "v1.9.1",
            "v1.9.0",
            "v1.9.0-rc2",
            "v1.9.0-rc1",
            "v1.8.0",
            "v1.8.0-rc1",
            "v1.7.0-rc3",
            "v1.7.0-rc2",
            "v1.7.0-rc1",
            "v1.6.1",
            "v1.6.0",
            "v1.6.0-rc2",
            "v1.6.0-rc1",
            "v1.5.0",
            "v1.5.0-rc2",
            "v1.5.0-rc1",
            "v1.4.1",
            "v1.4.0",
            "v1.4.0-rc1",
            "v1.3.2",
            "v1.3.1",
            "v1.3.0",
            "v1.3.0-rc3",
            "v1.3.0-rc2",
            "v1.3.0-rc1",
            "v1.2.1",
            "v1.2.0",
            "v1.2.0-rc2",
            "v1.2.0-rc1",
            "v1.1.0",
            "v1.1.0-rc3",
            "v1.1.0-rc2",
            "v1.1.0-rc1",
            "v1.0.0",
            "v1.0.0-rc2",
            "v1.0.0-rc1",
            "v0.34.1",
            "v0.34.0",
            "v0.34.0-rc2",
            "v0.34.0-rc1",
            "v0.33.0",
            "v0.33.0-rc4",
            "v0.33.0-rc3",
            "v0.33.0-rc2",
            "v0.33.0-rc1",
            "v0.32.4"
          ],
          "database_specific": {
            "source": "https://cna.erlef.org/osv/EEF-CVE-2026-103061.json"
          }
        }
      ],
      "modified": "2026-10-12T18:41:09.524070814Z",
      "provider": "osv",
      "references": [
        "https://github.com/gleam-lang/gleam/security/advisories/GHSA-jhcr-c7qm-8589",
        "https://cna.erlef.org/cves/CVE-2026-103061.html",
        "https://github.com/gleam-lang/gleam/commit/d13f27ee80aae7a521d2e9433c4deaf53f892574",
        "https://github.com/gleam-lang/gleam/commit/d15c981fac6e533d70ac8ee89a6ef4dbf139adc3",
        "https://github.com/gleam-lang/gleam/commit/54bbb2b98af1505b6eed93c45b1936fc76412e5c"
      ],
      "provider_metadata": {
        "cpe_ids": [
          "cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*"
        ],
        "cwe_ids": [
          "CWE-22"
        ],
        "capec_ids": [
          "CAPEC-126"
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-103061",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 306476,
  "published_at": "2026-10-12T18:23:41.507+00:00"
}