2026-04-11 12:59CVE-2026-32146EEF
PUBLISHED5.2CWE-22

Improper Path Validation in Git Dependency Handling Allows Arbitrary File System Modification

Improper path validation vulnerability in the Gleam compiler's handling of git dependencies allows arbitrary file system modification during dependency download.

Dependency names from gleam.toml and manifest.toml are incorporated into filesystem paths without sufficient validation or confinement to the intended dependency directory, allowing attacker-controlled paths (via relative traversal such as ../ or absolute paths) to target filesystem locations outside that directory. When resolving git dependencies (e.g. via gleam deps download), the computed path is used for filesystem operations including directory deletion and creation.

This vulnerability occurs during the dependency resolution and download phase, which is generally expected to be limited to fetching and preparing dependencies within a confined directory. A malicious direct or transitive git dependency can exploit this issue to delete and overwrite arbitrary directories outside the intended dependency directory, including attacker-chosen absolute paths, potentially causing data loss. In some environments, this may be further leveraged to achieve code execution, for example by overwriting git hooks or shell configuration files.

This issue affects Gleam from 1.9.0-rc1 until 1.15.3 and 1.16.0-rc1.

Problem type

Affected products

Gleam

Gleam

< * - AFFECTED

Gleam

< * - AFFECTED

< * - AFFECTED

References

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-32146
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-32146",
    "assignerOrgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
    "assignerShortName": "EEF",
    "dateUpdated": "2026-04-11T12:59:22.911Z",
    "dateReserved": "2026-03-10T22:37:29.213Z",
    "datePublished": "2026-04-11T12:59:22.911Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "6b3ad84c-e1a6-4bf7-a703-f496b71e49db",
        "shortName": "EEF",
        "dateUpdated": "2026-04-11T12:59:22.911Z"
      },
      "title": "Improper Path Validation in Git Dependency Handling Allows Arbitrary File System Modification",
      "descriptions": [
        {
          "lang": "en",
          "value": "Improper path validation vulnerability in the Gleam compiler's handling of git dependencies allows arbitrary file system modification during dependency download.\n\nDependency names from gleam.toml and manifest.toml are incorporated into filesystem paths without sufficient validation or confinement to the intended dependency directory, allowing attacker-controlled paths (via relative traversal such as ../ or absolute paths) to target filesystem locations outside that directory. When resolving git dependencies (e.g. via gleam deps download), the computed path is used for filesystem operations including directory deletion and creation.\n\nThis vulnerability occurs during the dependency resolution and download phase, which is generally expected to be limited to fetching and preparing dependencies within a confined directory. A malicious direct or transitive git dependency can exploit this issue to delete and overwrite arbitrary directories outside the intended dependency directory, including attacker-chosen absolute paths, potentially causing data loss. In some environments, this may be further leveraged to achieve code execution, for example by overwriting git hooks or shell configuration files.\n\nThis issue affects Gleam from 1.9.0-rc1 until 1.15.3 and 1.16.0-rc1.",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "value": "Improper path validation vulnerability in the Gleam compiler's handling of git dependencies allows arbitrary file system modification during dependency download.<p>Dependency names from <tt>gleam.toml</tt> and <tt>manifest.toml</tt> are incorporated into filesystem paths without sufficient validation or confinement to the intended dependency directory, allowing attacker-controlled paths (via relative traversal such as <tt>../</tt> or absolute paths) to target filesystem locations outside that directory. When resolving git dependencies (e.g. via <tt>gleam deps download</tt>), the computed path is used for filesystem operations including directory deletion and creation.</p><p>This vulnerability occurs during the dependency resolution and download phase, which is generally expected to be limited to fetching and preparing dependencies within a confined directory. A malicious direct or transitive git dependency can exploit this issue to delete and overwrite arbitrary directories outside the intended dependency directory, including attacker-chosen absolute paths, potentially causing data loss. In some environments, this may be further leveraged to achieve code execution, for example by overwriting git hooks or shell configuration files.</p><p>This issue affects Gleam from 1.9.0-rc1 until 1.15.3 and 1.16.0-rc1.</p>"
            }
          ]
        }
      ],
      "affected": [
        {
          "vendor": "Gleam",
          "product": "Gleam",
          "packageName": "gleam",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "1.9.0-rc1",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "*"
            }
          ]
        },
        {
          "vendor": "Gleam",
          "product": "Gleam",
          "collectionURL": "https://github.com",
          "packageName": "gleam-lang/gleam",
          "repo": "https://github.com/gleam-lang/gleam",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "1.9.0-rc1",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "*"
            },
            {
              "version": "a4fde22445ab8e5cc79c2ff48971616cb570702c",
              "status": "affected",
              "versionType": "git",
              "lessThan": "*"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')",
              "cweId": "CWE-22",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/gleam-lang/gleam/security/advisories/GHSA-vq5j-55vx-wq8j",
          "tags": [
            "vendor-advisory",
            "related"
          ]
        },
        {
          "url": "https://cna.erlef.org/cves/CVE-2026-32146.html",
          "tags": [
            "related"
          ]
        },
        {
          "url": "https://osv.dev/vulnerability/EEF-CVE-2026-32146",
          "tags": [
            "related"
          ]
        },
        {
          "url": "https://github.com/gleam-lang/gleam/commit/1aa5d8e594b0aa240bb213fce6ee19c65e6d5bcf",
          "tags": [
            "patch"
          ]
        },
        {
          "url": "https://github.com/gleam-lang/gleam/commit/55bb36e6d7febfbbc48c4d001e0ae13eb0312d78",
          "tags": [
            "patch"
          ]
        }
      ],
      "impacts": [
        {
          "capecId": "CAPEC-139",
          "descriptions": [
            {
              "lang": "en",
              "value": "CAPEC-139 Relative Path Traversal"
            }
          ]
        },
        {
          "capecId": "CAPEC-597",
          "descriptions": [
            {
              "lang": "en",
              "value": "CAPEC-597 Absolute Path Traversal"
            }
          ]
        }
      ],
      "metrics": [
        {
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "configurations": [
        {
          "lang": "en",
          "value": "The project must use git-based dependencies (direct or transitive). Projects that exclusively use Hex dependencies are not affected.\n\nProjects that exclusively use trusted or personally controlled git dependencies, or dependencies pinned to verified commit SHAs, are not exposed.",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "value": "<p>The project must use git-based dependencies (direct or transitive). Projects that exclusively use Hex dependencies are not affected.</p><p>Projects that exclusively use trusted or personally controlled git dependencies, or dependencies pinned to verified commit SHAs, are not exposed.</p>"
            }
          ]
        }
      ],
      "workarounds": [
        {
          "lang": "en",
          "value": "* Avoid using untrusted git dependencies, especially without pinning to a specific commit SHA\n* Review dependency trees carefully, including transitive git dependencies\n* Run dependency resolution commands in a restricted or isolated environment (e.g. containers)",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "value": "<ul><li>Avoid using untrusted git dependencies, especially without pinning to a specific commit SHA</li><li>Review dependency trees carefully, including transitive git dependencies</li><li>Run dependency resolution commands in a restricted or isolated environment (e.g. containers)</li></ul>"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "John Downey",
          "type": "remediation developer"
        },
        {
          "lang": "en",
          "value": "Louis Pilfold",
          "type": "analyst"
        },
        {
          "lang": "en",
          "value": "Jonatan Männchen / EEF",
          "type": "coordinator"
        }
      ]
    }
  }
}