Skip to content
Heist/ feed
Back to feed
Medium

Path traversal in Gleam via unvalidated package application names

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-103061
Confirmed fixed CVEs
Not specified
Updated in this feed
8 Nov 2026, 02:30 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

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.

osv:CVE-2026-103061
Complete source record
{
  "id": "4b4ce360839d92133aa07c342519f70a70d58033c619130fa99f2ec6bf4679aa",
  "url": "https://osv.dev/vulnerability/CVE-2026-103061",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Path traversal in Gleam via unvalidated package application names",
    "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.",
    "evidence": "osv:CVE-2026-103061",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "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"
                },
                {
                  "introduced": "2b1f4f8b0b4bc0223d44a1f0f6fce8bdaabdb176"
                },
                {
                  "fixed": "ed41eace2dd89054eb2d744c33925261d1eff32e"
                },
                {
                  "fixed": "d13f27ee80aae7a521d2e9433c4deaf53f892574"
                },
                {
                  "fixed": "54bbb2b98af1505b6eed93c45b1936fc76412e5c"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "d13f27ee80aae7a521d2e9433c4deaf53f892574"
                      },
                      {
                        "fixed": "d15c981fac6e533d70ac8ee89a6ef4dbf139adc3"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "ChangesAt"
                  },
                  {
                    "range": [
                      {
                        "introduced": "0.32.4"
                      },
                      {
                        "fixed": "1.19.2"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-elixir"
                      },
                      {
                        "fixed": "v1.19.2-elixir"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-erlang"
                      },
                      {
                        "fixed": "v1.19.2-erlang"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-node"
                      },
                      {
                        "fixed": "v1.19.2-node"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-node-slim"
                      },
                      {
                        "fixed": "v1.19.2-node-slim"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-elixir-slim"
                      },
                      {
                        "fixed": "v1.19.2-elixir-slim"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-erlang-slim"
                      },
                      {
                        "fixed": "v1.19.2-erlang-slim"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-erlang-alpine"
                      },
                      {
                        "fixed": "v1.19.2-erlang-alpine"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-elixir-alpine"
                      },
                      {
                        "fixed": "v1.19.2-elixir-alpine"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-node-alpine"
                      },
                      {
                        "fixed": "v1.19.2-node-alpine"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "v0.32.4-scratch"
                      },
                      {
                        "fixed": "v1.19.2-scratch"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "fixed": "d13f27ee80aae7a521d2e9433c4deaf53f892574"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "d15c981fac6e533d70ac8ee89a6ef4dbf139adc3"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "54bbb2b98af1505b6eed93c45b1936fc76412e5c"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "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://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-103061.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:52.770706192Z",
      "provider": "osv",
      "references": [
        "https://cna.erlef.org/cves/CVE-2026-103061.html",
        "https://ghcr.io",
        "https://github.com",
        "https://osv.dev/vulnerability/EEF-CVE-2026-103061",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/103xxx/CVE-2026-103061.json",
        "https://github.com/gleam-lang/gleam/security/advisories/GHSA-jhcr-c7qm-8589",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-103061",
        "https://github.com/gleam-lang/gleam/commit/54bbb2b98af1505b6eed93c45b1936fc76412e5c",
        "https://github.com/gleam-lang/gleam/commit/d13f27ee80aae7a521d2e9433c4deaf53f892574",
        "https://github.com/gleam-lang/gleam/commit/d15c981fac6e533d70ac8ee89a6ef4dbf139adc3",
        "https://github.com/gleam-lang/gleam"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-22"
        ],
        "cna_assigner": "EEF",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/103xxx/CVE-2026-103061.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-103061",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 521802,
  "published_at": "2026-10-12T18:23:41.507+00:00"
}