CVE-2026-42576: Chainguard.dev/apko Apko `DiscoverKeys` Has A Panic Vulnerability
MODERATECVE-2026-42576 is a MODERATE (CVSS 6.5) apko `discoverkeys` has a panic vulnerability (CWE-704: Incorrect Type Conversion or Cast) affecting Chainguard.dev/apko libraries in the Go ecosystem. The issue involves apko `discoverkeys` has a panic on non-rsa jwks key that causes crash during key discovery. Remediation is available by upgrading affected packages to version 1.2.7.
CVE-2026-42576 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2026-42576
To remediate this vulnerability, upgrade all affected Chainguard.dev/apko dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade chainguard.dev/apko to 1.2.7
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for chainguard.dev/apko
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-42576, inspect your project dependencies for Chainguard.dev/apko:
inspect dependencies for chainguard.dev/apko
Analyze the terminal output to locate any version of Chainguard.dev/apko in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.7), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-704: Incorrect Type Conversion or Cast, where the product does not correctly convert an object, resource, or structure from one type to a different type. In Chainguard.dev/apko, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-42576 Affected Chainguard.dev/apko Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
chainguard.dev/apko
|
Go |
< 1.2.7
|
1.2.7
|
References
Frequently Asked Questions
What is CVE-2026-42576?
Which Chainguard.dev/apko versions are affected?
What version fixes CVE-2026-42576?
Is chainguard.dev/apko affected?
What is the CVSS score of CVE-2026-42576?
What CWE is associated with CVE-2026-42576?
How can I check Go dependencies for CVE-2026-42576?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m7hm-vm4x-28jf",
"modified" : "2026-05-13T13:42:36Z",
"published" : "2026-05-04T21:25:30Z",
"aliases" : [ "CVE-2026-42576" ],
"summary" : "apko `DiscoverKeys` has a panic on non-rsa jwks key that causes crash during key discovery",
"details" : "`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.\n\n**Fix:** No fix available yet.\n\n**Acknowledgements**\n\napko thanks Oleh Konko from [1seal](https://1seal.org/) for discovering and reporting this issue.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "chainguard.dev/apko"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.7"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/chainguard-dev/apko/security/advisories/GHSA-m7hm-vm4x-28jf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42576"
}, {
"type" : "WEB",
"url" : "https://github.com/chainguard-dev/apko/commit/6604826b19e36e9bc6e196592800fad93738f4a1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/chainguard-dev/apko"
}, {
"type" : "WEB",
"url" : "https://github.com/chainguard-dev/apko/releases/tag/v1.2.7"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-704" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-04T21:25:30Z",
"nvd_published_at" : "2026-05-09T20:16:29Z"
}
}