CVE-2023-49290 Malicious parameters can cause a denial of service in lestrrat-go/jwx
An attacker can cause a denial of service in the lestrrat-go/jwx library by setting an excessively high p2c parameter in JWE headers.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-49290?
CVE-2023-49290 is a medium-severity denial of service vulnerability in lestrrat-go jwx, published on 4 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-400
Which versions are affected by CVE-2023-49290?
6 open source packages ship an affected version, including github.com/lestrrat-go/jwx and github.com/lestrrat-go/jwx/v2. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/lestrrat-go/jwx Go | All versions | 1.2.27 |
github.com/lestrrat-go/jwx Go | All versions | 1.2.27 |
github.com/lestrrat-go/jwx Go | All versions | 1.2.27 |
github.com/lestrrat-go/jwx/v2 Go | All versions | 2.0.18 |
github.com/lestrrat-go/jwx/v2 Go | All versions | 2.0.18 |
github.com/lestrrat-go/jwx/v2 Go | All versions | 2.0.18 |
Products include Lestrrat-Go Jwx.
How do I fix CVE-2023-49290?
Upgrade github.com/lestrrat-go/jwx to 1.2.27 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2023-49290 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-49290 exists.
Other vulnerabilities in lestrrat-go jwx
Sources
Also known as GHSA-7f9x-gw85-8grf, GO-2023-2379, MINI-2v42-w5h3-9jwf, MINI-528m-5c78-877j, MINI-8xvj-jv4h-j35x, MINI-fxcj-487f-82g9 and 8 more.