{"id":"CVE-2025-54059","aliases":["CVE-2025-54059","GHSA-5662-cv6m-63wh","GO-2025-3815"],"related":["CGA-jjfv-8pqp-q3gc"],"kind":"vulnerability","state":"published","title":"melange creates SBOM files in APKs with world-writable permissions","summary":"melange allows users to build apk packages using declarative pipelines. Starting in version 0.23.0 and prior to version 0.29.5, SBOM files generated by melange in apks had file system permissions mode 666. This potentially allows an unprivileged user to tamper with apk SBOMs on a running image, potentially confusing security scanners. An attacker could also perform a DoS under special circumstances. Version 0.29.5 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"melange allows users to build apk packages using declarative pipelines. Starting in version 0.23.0 and prior to version 0.29.5, SBOM files generated by melange in apks had file system permissions mode 666. This potentially allows an unprivileged user to tamper with apk SBOMs on a running image, potentially confusing security scanners. An attacker could also perform a DoS under special circumstances. Version 0.29.5 fixes the issue.","source":"cvelist"},{"lang":"en","text":"It was discovered that the SBOM files generated by melange in apks had file system permissions mode 666:\n```\n$ apkrane ls https://packages.wolfi.dev/os/x86_64/APKINDEX.tar.gz -P hello-wolfi --full --latest  | xargs wget -q -O  - | tar tzv 2>/dev/null var/lib/db/sbom\ndrwxr-xr-x root/root         0 2025-06-23 14:17 var/lib/db/sbom\n-rw-rw-rw- root/root      3383 2025-06-23 14:17 var/lib/db/sbom/hello-wolfi-2.12.2-r1.spdx.json\n```\n\nThis issue was introduced in commit 1b272db (\"Persist workspace filesystem throughout package builds (#1836)\") ([v0.23.0](https://github.com/chainguard-dev/melange/releases/tag/v0.23.0)).\n\n### Impact\nThis potentially allows an unprivileged user to tamper with apk SBOMs on a running image, potentially confusing security scanners. An attacker could also perform a DoS under special circumstances.\n\n### Patches\nThis issue was addressed in melange in e29494b (\"fix: tighten up permissions for written SBOM files and signature tarballs (#2086)\") ([v0.29.5](https://github.com/chainguard-dev/melange/releases/tag/v0.29.5)).\n\n## Acknowledgements\n\nThanks to Cody Harris [H2O.ai](https://h2o.ai/) and Markus Boehme for independently reporting this issue.","format":"markdown","source":"ghsa"},{"lang":"en","text":"melange's world-writable permissions expose SBOM files to potential image tampering in chainguard.dev/melange","format":"markdown","source":"go"},{"lang":"es","text":"Melange permite a los usuarios crear paquetes APK mediante pipelines declarativos. A partir de la versión 0.23.0 y anteriores a la 0.29.5, los archivos SBOM generados por Melange en APK tenían permisos de sistema de archivos en modo 666. Esto podría permitir que un usuario sin privilegios altere los SBOM de APK en una imagen en ejecución, lo que podría confundir a los escáneres de seguridad. Un atacante también podría realizar un ataque de DoS en circunstancias especiales. La versión 0.29.5 corrige el problema.","source":"nvd"}],"published":"2025-07-18T15:40:43.277Z","modified":"2026-09-10T03:50:25.741Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L","score":4.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L","score":4.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L","score":4.4,"rating":"MEDIUM"}],"cwes":["CWE-276"],"affected":[{"ranges":[{"version":">= 0.23.0, < 0.29.5","status":"affected"}],"vendor":"chainguard-dev","product":"melange","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.23.0","status":"affected","fixed":"0.29.5"}],"ecosystem":"Go","package":"chainguard.dev/melange","purl":"pkg:golang/chainguard.dev/melange","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.23.0","status":"affected","fixed":"0.29.5"}],"ecosystem":"Go","package":"chainguard.dev/melange","purl":"pkg:golang/chainguard.dev/melange","source":"go"}],"references":[{"url":"https://github.com/chainguard-dev/melange/security/advisories/GHSA-5662-cv6m-63wh","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/chainguard-dev/melange/pull/1836","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/chainguard-dev/melange/pull/2086","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/chainguard-dev/melange/commit/1b272db2a0bb3441553284cc56d87236b4b64c04","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/chainguard-dev/melange/commit/e29494b4a40a91619ec1c87a09003c6d5164cea1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/chainguard-dev/melange/releases/tag/v0.23.0","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/chainguard-dev/melange/releases/tag/v0.29.5","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-54059","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/chainguard-dev/melange","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-07-18T15:53:51.678Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-54059","url":"https://www.cve.org/CVERecord?id=CVE-2025-54059","licence":"CVE Terms of Use","modified":"2025-07-18T16:04:30.154Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5662-cv6m-63wh","url":"https://github.com/advisories/GHSA-5662-cv6m-63wh","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:25.741Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2025-3815","url":"https://pkg.go.dev/vuln/GO-2025-3815","licence":"CC-BY-4.0","modified":"2026-02-04T03:59:53.639Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-54059","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-54059","licence":"Public domain","modified":"2026-06-17T09:39:20.900Z"}],"updatedAt":"2026-11-25T22:59:01.416Z","epss":{"score":0.00153,"percentile":0.04667,"date":"2026-12-01T12:00:22.000Z"}}