Skip to main content

apko CVE-2026-42576

MEDIUM
Incorrect Type Conversion or Cast (CWE-704)
2026-05-04 https://github.com/chainguard-dev/apko GHSA-m7hm-vm4x-28jf
6.5
CVSS 3.1 · Vendor: https://github.com/chainguard-dev/apko
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Configure malicious APK repository with non-RSA JWKS key
  2. Delivery
    User runs apko build workflow
  3. Exploit
    apko fetches JWKS from malicious endpoint
  4. Execution
    Type assertion fails on EC/non-RSA key
  5. Persist
    Panic crashes apko process
  6. Impact
    Build pipeline halts

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Correct type conversion
Exploitation Conditions

The vulnerability requires that a repository JWKS endpoint returns a non-RSA key type (e.g., elliptic curve). Exploitation occurs when apko initializes the APK database and attempts key discovery, which happens during the normal course of any container build workflow using an affected APK repository. The attack surface is limited to scenarios where users configure APK repositories pointing to attacker-controlled or compromised JWKS endpoints, or where an attacker performs a man-in-the-middle attack on HTTPS traffic to inject a non-RSA key. Default apko configurations using only official Chainguard or Alpine repositories are not affected unless those endpoints are compromised. No authentication bypass or privilege escalation is required-any network user can serve a malicious JWKS response if they control the repository endpoint or can intercept traffic.

Impact

While CVSS 6.5 indicates medium severity, the real-world risk is context-dependent. The CVSS vector (AV:N/AC:L/PR:N/UI:R/S:U) confirms network accessibility and low attack complexity, but requires user interaction-meaning an attacker must trick a user into running apko against a malicious repository or compromise a legitimate JWKS endpoint. The availability impact is absolute (denial of service via crash), but scope is limited to the apko process itself with no code execution or data breach potential. The absence of any public exploit code or CISA KEV listing suggests this is not yet under active attack. However, defenders should note that the vulnerability is trivial to exploit (simply return a non-RSA key from JWKS) and would immediately halt container builds for affected users. The lack of a released patch as of the analysis date elevates practical risk for organizations that depend on apko in CI/CD pipelines, particularly if they use third-party or less-trusted APK repositories. EPSS data is unavailable, but the low barrier to exploitation (AC:L/PR:N) suggests moderate weaponization likelihood if attackers target supply chains.

Exploit ScenarioDerived

An attacker compromises or spoofs a repository JWKS endpoint and returns an elliptic curve public key instead of an RSA key. When a user runs apko to build a container image with that repository configured, the DiscoverKeys function fetches the malicious JWKS, attempts to cast the EC key as an RSA key, and the type assertion panics, crashing the apko process and halting the entire build pipeline.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 04, 2026

Apko crashes via denial-of-service when a repository JWKS endpoint returns a non-RSA key due to an unchecked type assertion in the DiscoverKeys function. The vulnerability affects any workflow initializing the APK database and requires user interaction to trigger (e.g., running apko with a malicious repository), with CVSS 6.5 reflecting the availability impact. No patch is currently available, though the issue is confirmed and acknowledged by the apko maintainers.

RemediationAI

Upgrade apko to version 1.2.7 or later, which resolves the unchecked type assertion by validating JWKS key types before casting. If immediate upgrade is not feasible, implement network-layer compensating controls: restrict outbound connections from CI/CD runners to only trusted, internally-managed APK repository JWKS endpoints using firewall rules or proxy filtering, and disable or remove any APK repository configurations pointing to external or untrusted sources. A secondary mitigation would involve running apko in a containerized sandbox with resource limits to prevent process crashes from affecting the host system, though this does not prevent the denial of service to the build pipeline itself. Review all configured APK repository endpoints to identify high-risk sources, and prioritize upgrades for environments using third-party repositories. See GitHub advisory GHSA-m7hm-vm4x-28jf for official guidance.

Affected Packages

go chainguard.dev/apko fix: 1.2.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in go

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability exists in the DiscoverKeys function within pkg/apk/apk/implementation.go of apko, a tool for building container images using APK packages. The function fetches JSON Web Key Sets (JWKS) from repository endpoints to verify package signatures. The root cause (CWE-704: Incorrect Type Conversion or Cast) stems from an unconditional type assertion that assumes all JWKS keys are RSA public keys without validating the actual key type. When a repository returns elliptic curve (EC) or other non-RSA keys, the assertion fails at runtime, triggering a Go panic that crashes the apko process. This affects the APK package manager integration layer responsible for key discovery during database initialization.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/chainguard-dev/apko) PRIMARY 6.5 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
SUSE MEDIUM

Primary rating from Vendor (https://github.com/chainguard-dev/apko).

CVSS VectorVendor: https://github.com/chainguard-dev/apko

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 91% exploitable
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium
NVD CVE.org EPSS GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:go/chainguard.dev_apko

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy