Security Vulnerability Report
中文
CVE-2026-42575 CVSS 7.5 HIGH

CVE-2026-42575

Published: 2026-05-09 20:16:30
Last Modified: 2026-05-09 20:16:30

Description

apko allows users to build and publish OCI container images built from apk packages. Prior to version 1.2.7, apko verifies the signature on APKINDEX.tar.gz but never compares individually downloaded .apk packages against the checksum recorded in the signed index. The checksum is parsed and available via ChecksumString(), and the downloaded package control hash is computed, but the two values are never compared in getPackageImpl(). Mismatched packages are silently accepted. An attacker who can substitute download responses (compromised mirror, HTTP repository, poisoned CDN cache) can install arbitrary packages into built images. This issue has been patched in version 1.2.7.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Configurations (Affected Products)

No configuration data available.

apko < 1.2.7

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC Concept: Demonstration of the missing checksum verification logic # This script simulates the vulnerable behavior in apko < 1.2.7 def verify_package_vulnerable(index_checksum, downloaded_package_hash): # Vulnerable logic: Parse values but do not compare print(f"[VULNERABLE] Index Checksum: {index_checksum}") print(f"[VULNERABLE] Downloaded Hash: {downloaded_package_hash}") # Missing: if index_checksum != downloaded_package_hash: raise Error print("[VULNERABLE] Package accepted without hash comparison!") return True def verify_package_patched(index_checksum, downloaded_package_hash): # Patched logic in v1.2.7 print(f"[PATCHED] Index Checksum: {index_checksum}") print(f"[PATCHED] Downloaded Hash: {downloaded_package_hash}") if index_checksum != downloaded_package_hash: print("[PATCHED] ERROR: Hash mismatch! Package rejected.") return False print("[PATCHED] Package verified successfully.") return True # Simulation if __name__ == "__main__": # Attacker modifies the package, changing the hash original_hash = "abc123" tampered_hash = "deadbeef" print("--- Simulating Attack ---") verify_package_vulnerable(original_hash, tampered_hash) print("") print("--- Simulating Patched Behavior ---") verify_package_patched(original_hash, tampered_hash)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42575", "sourceIdentifier": "[email protected]", "published": "2026-05-09T20:16:29.573", "lastModified": "2026-05-09T20:16:29.573", "vulnStatus": "Received", "cveTags": [], "descriptions": [{"lang": "en", "value": "apko allows users to build and publish OCI container images built from apk packages. Prior to version 1.2.7, apko verifies the signature on APKINDEX.tar.gz but never compares individually downloaded .apk packages against the checksum recorded in the signed index. The checksum is parsed and available via ChecksumString(), and the downloaded package control hash is computed, but the two values are never compared in getPackageImpl(). Mismatched packages are silently accepted. An attacker who can substitute download responses (compromised mirror, HTTP repository, poisoned CDN cache) can install arbitrary packages into built images. This issue has been patched in version 1.2.7."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-345"}, {"lang": "en", "value": "CWE-494"}]}], "references": [{"url": "https://github.com/chainguard-dev/apko/commit/a118c3d604107532b5525bd4bee2fb369a6228aa", "source": "[email protected]"}, {"url": "https://github.com/chainguard-dev/apko/releases/tag/v1.2.7", "source": "[email protected]"}, {"url": "https://github.com/chainguard-dev/apko/security/advisories/GHSA-hcwr-pq9g-rq3m", "source": "[email protected]"}]}}