# CVE-2024-21664: GO-2024-2454 - Panic due to nil pointer dereference in github.com/lestrrat-go/jwx/v2

Source: https://junglewise.ai/threats/cve-2024-21664-parsing-json-serialized-payload-without-protected-field-can-lead  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-01-23  
License: CC BY 4.0 with a link back

CVE-2024-21664 · Severity: low · CVSS 3.1 · Published 2024-01-23

Panic due to nil pointer dereference in github.com/lestrrat-go/jwx/v2

Technologies: [github.com/lestrrat-go/jwx (Go)](https://junglewise.ai/threats/technologies/github-com-lestrrat-go-jwx), [github.com/lestrrat-go/jwx/v2 (Go)](https://junglewise.ai/threats/technologies/github-com-lestrrat-go-jwx-v2). Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is CVE-2024-21664 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-21664 being exploited in the wild.

**How severe is CVE-2024-21664?** Low severity, with a CVSS score of 3.1, published 23 January 2024.

**Which products and versions are affected?** github.com/lestrrat-go/jwx (Go) SEMVER:introduced=1.0.8,fixed=1.2.28; github.com/lestrrat-go/jwx/v2 (Go) SEMVER:introduced=0,fixed=2.0.19.

**Is there a fix for CVE-2024-21664?** Yes. github.com/lestrrat-go/jwx (Go): upgrade to 1.2.28 or later; github.com/lestrrat-go/jwx/v2 (Go): upgrade to 2.0.19 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2024-21664?** Check whether you run github.com/lestrrat-go/jwx (Go) or github.com/lestrrat-go/jwx/v2 (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/lestrrat-go/jwx (Go): upgrade to 1.2.28 or later

  ```sh
  go get github.com/lestrrat-go/jwx@v1.2.28
  ```

- github.com/lestrrat-go/jwx/v2 (Go): upgrade to 2.0.19 or later

  ```sh
  go get github.com/lestrrat-go/jwx/v2@v2.0.19
  ```


## Affected products

- github.com/lestrrat-go/jwx (Go) SEMVER:introduced=1.0.8,fixed=1.2.28
- github.com/lestrrat-go/jwx/v2 (Go) SEMVER:introduced=0,fixed=2.0.19

## Identifiers

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

## Related threats

- [GO-2024-2632 - JWX vulnerable to a denial of service attack using compressed JWE message in github.com/lestrrat-go/jwx](https://junglewise.ai/threats/cve-2024-28122-jwx-vulnerable-to-a-denial-of-service-attack-using-compressed-jwe)
- [GO-2023-2379 - Denial of service due to malicious parameters in github.com/lestrrat-go/jwx](https://junglewise.ai/threats/cve-2023-49290-lestrrat-go-jwx-s-malicious-parameters-in-jwe-can-cause-a-dos)
- [GO-2023-1859 - Padding oracle vulnerability in github.com/lestrrat-go/jwx](https://junglewise.ai/threats/go-2023-1859-padding-oracle-vulnerability-in-github-com-lestrrat-go-jwx-49cebe02)
- [github.com/lestrrat-go/jwx vulnerable to Potential Padding Oracle Attack](https://junglewise.ai/threats/github-com-lestrrat-go-jwx-vulnerable-to-potential-padding-oracle-094d592e)
