# CVE-2026-42576: Chainguard apko denial of service via incorrect type assertion in DiscoverKeys

Source: https://junglewise.ai/threats/cve-2026-42576-chainguard-apko-denial-of-service-via-incorrect-type-assertion-in  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-09. Updated: 2026-07-24  
License: CC BY 4.0 with a link back

CVE-2026-42576 · Severity: medium · CVSS 6.5 · Published 2026-05-09

apko is a tool used to build secure container images from APK packages. A vulnerability in how it handles security keys from remote repositories can cause the application to crash. If a user attempts to build an image using a repository that provides an unexpected key type, the build process will fail immediately, potentially disrupting automated software delivery pipelines.

Technologies: [Chainguard Apko](https://junglewise.ai/threats/technologies/apko), [chainguard.dev/apko (Go)](https://junglewise.ai/threats/technologies/chainguard-dev-apko). Vendors: [Chainguard](https://junglewise.ai/threats/vendors/chainguard), [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2026-42576 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-42576 being exploited in the wild.

**How severe is CVE-2026-42576?** Medium severity, with a CVSS score of 6.5, published 9 May 2026.

**Which products and versions are affected?** Chainguard Apko < 1.2.7; chainguard.dev/apko (Go) < 1.2.7, SEMVER:introduced=0,fixed=1.2.7.

**Is there a fix for CVE-2026-42576?** Yes. chainguard.dev/apko (Go): upgrade to 1.2.7 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-42576 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-42576?** Check whether you run Chainguard Apko or chainguard.dev/apko (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- chainguard.dev/apko (Go): upgrade to 1.2.7 or later

  ```sh
  go get chainguard.dev/apko@v1.2.7
  ```


## Technical details

A panic occurs in the `DiscoverKeys` function within `pkg/apk/apk/implementation.go` due to an incorrect type conversion. The code unconditionally type-asserts JWKS keys as `*rsa.PublicKey` without verifying the actual key type. If a remote repository's JWKS endpoint returns a non-RSA key (such as Elliptic Curve/EC), the unchecked assertion triggers a Go panic, crashing the apko process. This affects any workflow involving APK database initialization and key fetching. The issue is fixed in version 1.2.7 by implementing a guarded type assertion.

## Affected products

- Chainguard apko < 1.2.7

## Identifiers

- CVE-2026-42576
- GHSA-m7hm-vm4x-28jf
- GO-2026-5497

## Timeline

- 2026-04-23: patched: Version 1.2.7 released
- 2026-04-23: advisory: GitHub Security Advisory published
- 2026-05-09: disclosed: CVE-2026-42576 published to NVD

## References

- [https://github.com/chainguard-dev/apko/commit/6604826b19e36e9bc6e196592800fad93738f4a1](https://github.com/chainguard-dev/apko/commit/6604826b19e36e9bc6e196592800fad93738f4a1)
- [https://github.com/chainguard-dev/apko/releases/tag/v1.2.7](https://github.com/chainguard-dev/apko/releases/tag/v1.2.7)
- [https://github.com/chainguard-dev/apko/security/advisories/GHSA-m7hm-vm4x-28jf](https://github.com/chainguard-dev/apko/security/advisories/GHSA-m7hm-vm4x-28jf)

## Related threats

- [apko integer truncation in UID/GID parsing](https://junglewise.ai/threats/cve-2026-105768-apko-allows-users-to-build-and-publish-oci-container-images)
- [Chainguard Melange and Apko incomplete package integrity verification](https://junglewise.ai/threats/cve-2026-54174-chainguard-melange-and-apko-incomplete-package-integrity)
- [Chainguard apko insufficient integrity check for apk packages](https://junglewise.ai/threats/cve-2026-42575-chainguard-apko-insufficient-integrity-check-for-apk-packages)
- [Chainguard apko path traversal via symlink following in DirFS](https://junglewise.ai/threats/cve-2026-42574-chainguard-apko-path-traversal-via-symlink-following-in-dirfs)
- [GO-2026-4410 - apko affected by potential unbounded resource consumption in expandapk.ExpandApk on attacker-controlled…](https://junglewise.ai/threats/cve-2026-25140-go-2026-4410-apko-affected-by-potential-unbounded-resource)
