CVE-2026-25143: melange affected by potential host command execution via license-check YAML mode patch pipeline
An attacker who can influence inputs to the patch pipeline could execute arbitrary shell commands on the build host. The patch pipeline in pkg/build/pipelines/patch.yaml embeds input-derived values (series paths, patch filenames, and numeric parameters) into shell scripts without proper quoting or validation, allowing shell metacharacters to break out of their intended context. The vulnerability affects the built-in patch pipeline which can be invoked through melange build and melange license-check operations. An attacker who can control patch-related inputs (e.g., through pull request-driven CI, build-as-a-service, or by influencing melange configurations) can inject shell metacharacters such as backticks, command substitutions $(…), semicolons, pipes, or redirections to execute arbitrary commands with the privileges of the melange build process.
Fix: Fixed in bd132535 , Released in 0.40.3. Acknowledgements melange thanks Oleh Konko (@1seal) from 1seal for discovering and reporting this issue.
Other sources
melange allows users to build apk packages using declarative pipelines. From version 0.10.0 to before 0.40.3, an attacker who can influence inputs to the patch pipeline could execute arbitrary shell commands on the build host. The patch pipeline in pkg/build/pipelines/patch.yaml embeds input-derived values (series paths, patch filenames, and numeric parameters) into shell scripts without proper quoting or validation, allowing shell metacharacters to break out of their intended context. The vulnerability affects the built-in patch pipeline which can be invoked through melange build and melange license-check operations. An attacker who can control patch-related inputs (e.g., through pull request-driven CI, build-as-a-service, or by influencing melange configurations) can inject shell metacharacters such as backticks, command substitutions $(…), semicolons, pipes, or redirections to execute arbitrary commands with the privileges of the melange build process. This issue has been patched in version 0.40.3.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-25143?
CVE-2026-25143 has been classified as a critical vulnerability due to the potential for arbitrary code execution on the build host.
How do I fix CVE-2026-25143?
To mitigate CVE-2026-25143, upgrade to version 0.40.3 or later of the affected software.
What software is affected by CVE-2026-25143?
CVE-2026-25143 specifically affects the chainguard.dev/melange package versions between 0.10.0 and 0.40.3.
What type of attack does CVE-2026-25143 facilitate?
CVE-2026-25143 could allow an attacker to execute arbitrary shell commands on the build host by influencing inputs to the patch pipeline.
What are the implications of CVE-2026-25143?
The implications of CVE-2026-25143 include potential full system compromise if an attacker can exploit the vulnerability to run arbitrary commands.