Skip to content

← Actionable
Medium, CVSS 4.3

Parsing JSON serialized payload without protected field can lead to segfault

CVE-2024-21664GHSA-pvcr-v8j8-j5q3

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (github.com/lestrrat-go/jwx/v2 2.0.19; github.com/lestrrat-go/jwx 1.2.28), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
4.3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
EPSS
  • CVE-2024-21664: 0.86% estimated exploitation activity in the next 30 days; percentile 58.68 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary Calling jws.Parse with a JSON serialized payload where the signature field is present while protected is absent can lead to a nil pointer dereference. Details This seems to also affect other functions that calls Parse internally, like jws.Verify. My understanding of these functions from the docs is that they are supposed to fail gracefully on invalid input and don't require any prior validation. Based on the stack trace in the PoC, the issue seems to be that the processing done in jws/message.go:UnmarshalJSON() assumes that if a signature field is present, then a protected field is also present. If this is not the case, then the subsequent call to getB64Value(sig.protected) will dereference sig.protected, which is nil. PoC Reproducer: Result: Impact The vulnerability can be used to crash / DOS a system doing JWS verification.

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 1 · created ·

    Published from ghsa record GHSA-pvcr-v8j8-j5q3

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2024-21664

Advisory: Parsing JSON serialized payload without protected field can lead to segfault
IDs: CVE-2024-21664, GHSA-pvcr-v8j8-j5q3
Record: https://patchnext.com/advisories/cve-2024-21664 (revision 1, source checked 26 Oct 2026, 15:03 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 4.3)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: github.com/lestrrat-go/jwx/v2 2.0.19; github.com/lestrrat-go/jwx 1.2.28. A vendor fix does not mean a deployment is fixed.

## Affected components
- Go github.com/lestrrat-go/jwx/v2: affected < 2.0.19; fixed in 2.0.19
- Go github.com/lestrrat-go/jwx: affected >= 1.0.8, < 1.2.28; fixed in 1.2.28

## Suggested inspection (read-only)
- Go github.com/lestrrat-go/jwx/v2: check the installed version with your package manager.
- Go github.com/lestrrat-go/jwx: check the installed version with your package manager.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on github.com/lestrrat-go/jwx/v2, github.com/lestrrat-go/jwx.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-pvcr-v8j8-j5q3 (GitHub-reviewed advisory GHSA-pvcr-v8j8-j5q3 lists affected ranges: Go github.com/lestrrat-go/jwx/v2 >=0 =1.0.8 <1.2.28)

Commands are suggestions: review each one before running it.

Loading voting…