← Back to CVE Explorer

CVE-2026-103061

Full vulnerability record from the local CVENow database.

Description

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.

Severity
MEDIUM
CVSS score
5.9 (v4.0)
Vulnerability status
Deferred
Source identifier
6b3ad84c-e1a6-4bf7-a703-f496b71e49db
Published
2026-10-12 19:16:36.387000
Last modified
2026-11-10 18:17:17.400000
View original CVE JSON
{
  "id": "CVE-2026-103061",
  "sourceIdentifier": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
  "published": "2026-10-12T19:16:36.387",
  "lastModified": "2026-11-10T18:17:17.400",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "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.\n\nA 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.\n\nThis issue affects gleam: from 0.32.4 before 1.19.2."
    }
  ],
  "affected": [
    {
      "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
      "affectedData": [
        {
          "vendor": "Gleam",
          "product": "Gleam",
          "defaultStatus": "unaffected",
          "packageName": "gleam",
          "cpes": [
            "cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*"
          ],
          "modules": [
            "gleam_cli::dependencies",
            "gleam_core::manifest",
            "gleam_core::paths",
            "gleam_core::build::project_compiler",
            "gleam_cli::fs"
          ],
          "programFiles": [
            "compiler-cli/src/dependencies.rs",
            "compiler-core/src/manifest.rs",
            "compiler-core/src/paths.rs",
            "compiler-core/src/build/project_compiler.rs",
            "compiler-cli/src/fs.rs"
          ],
          "programRoutines": [
            {
              "name": "gleam_cli::dependencies::hex_manifest_package"
            },
            {
              "name": "gleam_core::manifest::ManifestPackage::application_name"
            },
            {
              "name": "gleam_core::paths::ProjectPaths::build_directory_for_package"
            },
            {
              "name": "gleam_core::build::project_compiler::ProjectCompiler::load_cache_or_compile_package"
            },
            {
              "name": "gleam_cli::fs::delete_directory"
            }
          ],
          "packageURL": "pkg:software-id/gleam.run/gleam",
          "versions": [
            {
              "version": "0.32.4",
              "lessThan": "1.19.2",
              "versionType": "semver",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Gleam",
          "product": "Gleam",
          "defaultStatus": "unaffected",
          "collectionURL": "https://ghcr.io",
          "packageName": "gleam-lang/gleam",
          "cpes": [
            "cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*"
          ],
          "modules": [
            "gleam_cli::dependencies",
            "gleam_core::manifest",
            "gleam_core::paths",
            "gleam_core::build::project_compiler",
            "gleam_cli::fs"
          ],
          "programFiles": [
            "compiler-cli/src/dependencies.rs",
            "compiler-core/src/manifest.rs",
            "compiler-core/src/paths.rs",
            "compiler-core/src/build/project_compiler.rs",
            "compiler-cli/src/fs.rs"
          ],
          "programRoutines": [
            {
              "name": "gleam_cli::dependencies::hex_manifest_package"
            },
            {
              "name": "gleam_core::manifest::ManifestPackage::application_name"
            },
            {
              "name": "gleam_core::paths::ProjectPaths::build_directory_for_package"
            },
            {
              "name": "gleam_core::build::project_compiler::ProjectCompiler::load_cache_or_compile_package"
            },
            {
              "name": "gleam_cli::fs::delete_directory"
            }
          ],
          "packageURL": "pkg:oci/gleam?repository_url=ghcr.io%2Fgleam-lang%2Fgleam",
          "versions": [
            {
              "version": "v0.32.4-elixir",
              "lessThan": "v1.19.2-elixir",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-erlang",
              "lessThan": "v1.19.2-erlang",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-node",
              "lessThan": "v1.19.2-node",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-node-slim",
              "lessThan": "v1.19.2-node-slim",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-elixir-slim",
              "lessThan": "v1.19.2-elixir-slim",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-erlang-slim",
              "lessThan": "v1.19.2-erlang-slim",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-erlang-alpine",
              "lessThan": "v1.19.2-erlang-alpine",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-elixir-alpine",
              "lessThan": "v1.19.2-elixir-alpine",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-node-alpine",
              "lessThan": "v1.19.2-node-alpine",
              "versionType": "other",
              "status": "affected"
            },
            {
              "version": "v0.32.4-scratch",
              "lessThan": "v1.19.2-scratch",
              "versionType": "other",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Gleam",
          "product": "Gleam",
          "defaultStatus": "unaffected",
          "collectionURL": "https://github.com",
          "packageName": "gleam-lang/gleam",
          "cpes": [
            "cpe:2.3:a:gleam-lang:gleam:*:*:*:*:*:*:*:*"
          ],
          "modules": [
            "gleam_cli::dependencies",
            "gleam_core::manifest",
            "gleam_core::paths",
            "gleam_core::build::project_compiler",
            "gleam_cli::fs"
          ],
          "programFiles": [
            "compiler-cli/src/dependencies.rs",
            "compiler-core/src/manifest.rs",
            "compiler-core/src/paths.rs",
            "compiler-core/src/build/project_compiler.rs",
            "compiler-cli/src/fs.rs"
          ],
          "programRoutines": [
            {
              "name": "gleam_cli::dependencies::hex_manifest_package"
            },
            {
              "name": "gleam_core::manifest::ManifestPackage::application_name"
            },
            {
              "name": "gleam_core::paths::ProjectPaths::build_directory_for_package"
            },
            {
              "name": "gleam_core::build::project_compiler::ProjectCompiler::load_cache_or_compile_package"
            },
            {
              "name": "gleam_cli::fs::delete_directory"
            }
          ],
          "repo": "https://github.com/gleam-lang/gleam",
          "packageURL": "pkg:github/gleam-lang/gleam",
          "versions": [
            {
              "version": "d13f27ee80aae7a521d2e9433c4deaf53f892574",
              "lessThan": "*",
              "versionType": "git",
              "status": "affected",
              "changes": [
                {
                  "at": "d15c981fac6e533d70ac8ee89a6ef4dbf139adc3",
                  "status": "unaffected"
                },
                {
                  "at": "54bbb2b98af1505b6eed93c45b1936fc76412e5c",
                  "status": "unaffected"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV40": [
      {
        "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
        "type": "Secondary",
        "cvssData": {
          "version": "4.0",
          "vectorString": "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/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",
          "baseScore": 5.9,
          "baseSeverity": "MEDIUM",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "attackRequirements": "PRESENT",
          "privilegesRequired": "NONE",
          "userInteraction": "ACTIVE",
          "vulnConfidentialityImpact": "NONE",
          "vulnIntegrityImpact": "NONE",
          "vulnAvailabilityImpact": "HIGH",
          "subConfidentialityImpact": "NONE",
          "subIntegrityImpact": "NONE",
          "subAvailabilityImpact": "NONE",
          "exploitMaturity": "NOT_DEFINED",
          "confidentialityRequirement": "NOT_DEFINED",
          "integrityRequirement": "NOT_DEFINED",
          "availabilityRequirement": "NOT_DEFINED",
          "modifiedAttackVector": "NOT_DEFINED",
          "modifiedAttackComplexity": "NOT_DEFINED",
          "modifiedAttackRequirements": "NOT_DEFINED",
          "modifiedPrivilegesRequired": "NOT_DEFINED",
          "modifiedUserInteraction": "NOT_DEFINED",
          "modifiedVulnConfidentialityImpact": "NOT_DEFINED",
          "modifiedVulnIntegrityImpact": "NOT_DEFINED",
          "modifiedVulnAvailabilityImpact": "NOT_DEFINED",
          "modifiedSubConfidentialityImpact": "NOT_DEFINED",
          "modifiedSubIntegrityImpact": "NOT_DEFINED",
          "modifiedSubAvailabilityImpact": "NOT_DEFINED",
          "Safety": "NOT_DEFINED",
          "Automatable": "NOT_DEFINED",
          "Recovery": "NOT_DEFINED",
          "valueDensity": "NOT_DEFINED",
          "vulnerabilityResponseEffort": "NOT_DEFINED",
          "providerUrgency": "NOT_DEFINED"
        }
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-10-16T17:49:26.374732Z",
          "id": "CVE-2026-103061",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-22"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://cna.erlef.org/cves/CVE-2026-103061.html",
      "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"
    },
    {
      "url": "https://github.com/gleam-lang/gleam/commit/54bbb2b98af1505b6eed93c45b1936fc76412e5c",
      "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"
    },
    {
      "url": "https://github.com/gleam-lang/gleam/commit/d13f27ee80aae7a521d2e9433c4deaf53f892574",
      "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"
    },
    {
      "url": "https://github.com/gleam-lang/gleam/commit/d15c981fac6e533d70ac8ee89a6ef4dbf139adc3",
      "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"
    },
    {
      "url": "https://github.com/gleam-lang/gleam/security/advisories/GHSA-jhcr-c7qm-8589",
      "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"
    },
    {
      "url": "https://osv.dev/vulnerability/EEF-CVE-2026-103061",
      "source": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db"
    }
  ]
}