CVE-2026-29050
Full vulnerability record from the local CVENow database.
Description
melange allows users to build apk packages using declarative pipelines. Starting in version 0.32.0 and prior to version 0.43.4, an attacker who can influence a melange configuration file — for example through pull-request-driven CI or build-as-a-service scenarios — could set `pipeline[].uses` to a value containing `../` sequences or an absolute path. The `(*Compiled).compilePipeline` function in `pkg/build/compile.go` passed `uses` directly to `filepath.Join(pipelineDir, uses + ".yaml")` without validating the value, so the resolved path could escape each `--pipeline-dir` and read an arbitrary YAML-parseable file visible to the melange process. Because the loaded file is subsequently interpreted as a melange pipeline and its `runs:` block is executed via `/bin/sh -c` in the build sandbox, this additionally allowed shell commands sourced from an out-of-tree file to run during the build, bypassing the review boundary that normally covers the in-tree pipeline definition. The issue is fixed in melange v0.43.4 via commit 5829ca4. The fix rejects `uses` values that are absolute paths or contain `..`, and verifies (via `filepath.Rel` after `filepath.Clean`) that the resolved target remains within the pipeline directory. As a workaround, only run `melange build` against configuration files from trusted sources. In CI systems that build user-supplied melange configs, gate builds behind manual review of `pipeline[].uses` values and reject any containing `..` or leading `/`.
View original CVE JSON
{
"id": "CVE-2026-29050",
"sourceIdentifier": "[email protected]",
"published": "2026-04-24T00:16:27.303",
"lastModified": "2026-10-26T22:10:00.163",
"vulnStatus": "Analyzed",
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "melange allows users to build apk packages using declarative pipelines. Starting in version 0.32.0 and prior to version 0.43.4, an attacker who can influence a melange configuration file — for example through pull-request-driven CI or build-as-a-service scenarios — could set `pipeline[].uses` to a value containing `../` sequences or an absolute path. The `(*Compiled).compilePipeline` function in `pkg/build/compile.go` passed `uses` directly to `filepath.Join(pipelineDir, uses + \".yaml\")` without validating the value, so the resolved path could escape each `--pipeline-dir` and read an arbitrary YAML-parseable file visible to the melange process. Because the loaded file is subsequently interpreted as a melange pipeline and its `runs:` block is executed via `/bin/sh -c` in the build sandbox, this additionally allowed shell commands sourced from an out-of-tree file to run during the build, bypassing the review boundary that normally covers the in-tree pipeline definition. The issue is fixed in melange v0.43.4 via commit 5829ca4. The fix rejects `uses` values that are absolute paths or contain `..`, and verifies (via `filepath.Rel` after `filepath.Clean`) that the resolved target remains within the pipeline directory. As a workaround, only run `melange build` against configuration files from trusted sources. In CI systems that build user-supplied melange configs, gate builds behind manual review of `pipeline[].uses` values and reject any containing `..` or leading `/`."
},
{
"lang": "es",
"value": "melange permite a los usuarios construir paquetes apk utilizando pipelines declarativos. A partir de la versión 0.32.0 y antes de la versión 0.43.4, un atacante que puede influir en un archivo de configuración de melange - por ejemplo, a través de CI impulsado por solicitudes de extracción o escenarios de construcción como servicio - podría establecer “pipeline[].uses” a un valor que contenga secuencias “.. / ” o una ruta absoluta. La función “(Compiled).compilePipeline” en “pkg/build/compile.go” pasó “uses” directamente a “filepath.Join(pipelineDir, uses + “.yaml”)” sin validar el valor, por lo que la ruta resuelta podría escapar de cada “--pipeline-dir” y leer un archivo arbitrario analizable por YAML visible para el proceso de melange. Debido a que el archivo cargado se interpreta posteriormente como un pipeline de melange y su bloque “runs:” se ejecuta a través de “/bin/sh -c” en la sandbox de construcción, esto permitió adicionalmente que comandos de shell obtenidos de un archivo fuera del árbol se ejecutaran durante la construcción, eludiendo el límite de revisión que normalmente cubre la definición del pipeline en el árbol. El problema se solucionó en melange v0.43.4 a través del commit 5829ca4. La solución rechaza los valores de “uses” que son rutas absolutas o que contienen “..”, y verifica (a través de “filepath.Rel” después de “filepath.Clean”) que el objetivo resuelto permanece dentro del directorio del pipeline. Como solución alternativa, solo ejecute “melange build” contra archivos de configuración de fuentes confiables. En sistemas CI que construyen configuraciones de melange proporcionadas por el usuario, restrinja las construcciones mediante una revisión manual de los valores de “pipeline[].uses” y rechace cualquiera que contenga “..” o un “/” inicial."
}
],
"affected": [
{
"source": "[email protected]",
"affectedData": [
{
"vendor": "chainguard-dev",
"product": "melange",
"versions": [
{
"version": ">= 0.32.0, < 0.43.4",
"status": "affected"
}
]
}
]
}
],
"metrics": {
"cvssMetricV31": [
{
"source": "[email protected]",
"type": "Secondary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N",
"baseScore": 6.1,
"baseSeverity": "MEDIUM",
"attackVector": "LOCAL",
"attackComplexity": "LOW",
"privilegesRequired": "NONE",
"userInteraction": "REQUIRED",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "LOW",
"availabilityImpact": "NONE"
},
"exploitabilityScore": 1.8,
"impactScore": 4.2
}
],
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"timestamp": "2026-04-25T01:38:21.243220Z",
"id": "CVE-2026-29050",
"options": [
{
"exploitation": "none"
},
{
"automatable": "no"
},
{
"technicalImpact": "partial"
}
],
"role": "CISA Coordinator",
"version": "2.0.3"
}
}
]
},
"weaknesses": [
{
"source": "[email protected]",
"type": "Secondary",
"description": [
{
"lang": "en",
"value": "CWE-22"
}
]
}
],
"configurations": [
{
"nodes": [
{
"operator": "OR",
"negate": false,
"cpeMatch": [
{
"vulnerable": true,
"criteria": "cpe:2.3:a:chainguard:melange:*:*:*:*:*:go:*:*",
"versionStartIncluding": "0.32.0",
"versionEndExcluding": "0.43.4",
"matchCriteriaId": "3E8363CF-5AF6-4FD7-A491-5D3E8E1F3576"
}
]
}
]
}
],
"references": [
{
"url": "https://github.com/chainguard-dev/melange/security/advisories/GHSA-98f2-w9h9-7fp9",
"source": "[email protected]",
"tags": [
"Mitigation",
"Patch",
"Vendor Advisory"
]
}
]
}