VDB
Sign up
MEDIUM6.5

GHSA-m7hm-vm4x-28jf

apko `DiscoverKeys` has a panic on non-rsa jwks key that causes crash during key discovery

Quick fix

GHSA-m7hm-vm4x-28jf — chainguard.dev/apko: upgrade to the fixed version with the command below.

go get chainguard.dev/apko@v1.2.7

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.

**Fix:** No fix available yet.

**Acknowledgements**

apko thanks Oleh Konko from [1seal](https://1seal.org/) for discovering and reporting this issue.

Are you affected?

Enter the version of the package you're using.

Affected packages

Go/chainguard.dev/apko
Introduced in: 0Fixed in: 1.2.7
Fixgo get chainguard.dev/apko@v1.2.7

References