GitHub Advisoryadvisory · Go
GHSA-m7hm-vm4x-28jf apko `DiscoverKeys` has a panic on non-rsa jwks key that causes crash during key discovery
MEDIUM
Official page ↗
- Aliases
- CVE-2026-42576
- Ecosystem
- Go
- Packages
- chainguard.dev/apko
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
- Weaknesses
- CWE-704
- Reviewed
- 2026-05-04
Affected packages
• Go chainguard.dev/apko: < 1.2.7 → fixed in 1.2.7
Description
`DiscoverKeys` in `pkg/apk/apk/implementation.go` unconditionally type-asserts JWKS keys as `*rsa.PublicKey` without checking the key type. If a repository JWKS endpoint returns a non-RSA key (e.g. EC), the unchecked assertion panics and crashes apko. This affects any workflow that initializes the APK database and fetches repository keys. Affected versions <= 0.30.34.
Fix: No fix available yet.
Acknowledgements
apko thanks Oleh Konko from 1seal for discovering and reporting this issue.
Related
Alias · CVE (1)
- CVE-2026-42576 apko allows users to build and publish OCI container images built from apk packages. vulnerability
Weakness · CWE (1)
- CWE-704 Incorrect Type Conversion or Cast weakness
References
- https://github.com/chainguard-dev/apko/security/advisories/GHSA-m7hm-vm4x-28jf web
- https://nvd.nist.gov/vuln/detail/CVE-2026-42576 advisory
- https://github.com/chainguard-dev/apko/commit/6604826b19e36e9bc6e196592800fad93738f4a1 web
- https://github.com/chainguard-dev/apko package
- https://github.com/chainguard-dev/apko/releases/tag/v1.2.7 web