CVE-2024-31033: Withdrawn JJWT Improperly Generates Signing Keys Vulnerability

MODERATE
Advisory Identifier: GHSA-r65j-6h5f-4f92
CVSS 6.8
CWE-327
Published
Advisory Summary

CVE-2024-31033 is a MODERATE (CVSS 6.8) jjwt improperly generates signing keys vulnerability (CWE-327: Use of a Broken or Risky Cryptographic Algorithm) affecting Withdrawn libraries in the Maven ecosystem. The issue involves jjwt improperly generates signing keys. Remediation is available in the latest vendor maintenance releases.

CVE-2024-31033 at a Glance

CVE Identifier CVE-2024-31033
GHSA Identifier GHSA-r65j-6h5f-4f92
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-327: Use of a Broken or Risky Cryptographic Algorithm
Affected Product Withdrawn
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-31033

To remediate this vulnerability, upgrade all affected Withdrawn dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.jsonwebtoken:jjwt-impl fixed: Latest secure release
<dependency>
    <groupId>io.jsonwebtoken</groupId>
    <artifactId>jjwt-impl</artifactId>
    <version>Latest secure release</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.jsonwebtoken

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-31033, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.jsonwebtoken

Analyze the terminal output to locate any version of Withdrawn in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.jsonwebtoken command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm, where the product uses a broken or risky cryptographic algorithm or protocol. In Withdrawn, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Withdrawn Advisory This advisory has been withdrawn because it has been found to be disputed. Please see the issue [here](https://github.com/jwtk/jjwt/issues/930#issuecomment-2032699358) for more information. ## Original Description JJWT (aka Java JWT) through 0.12.5 ignores certain characters and thus a user might falsely conclude that they have a strong key. The impacted code is the setSigningKey() method within the DefaultJwtParser class and the signWith() method within the DefaultJwtBuilder class.

CVE-2024-31033 Affected Withdrawn Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
io.jsonwebtoken:jjwt-impl
Maven
≤ 0.12.5

References

Frequently Asked Questions

What is CVE-2024-31033?
CVE-2024-31033 is a security vulnerability in Withdrawn involving JJWT improperly generates signing keys under CWE-327: Use of a Broken or Risky Cryptographic Algorithm.
Which Withdrawn versions are affected?
Affected versions include releases prior to current release patches across affected packages: io.jsonwebtoken:jjwt-impl.
What version fixes CVE-2024-31033?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is jjwt-impl affected?
Yes, io.jsonwebtoken:jjwt-impl is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-31033?
CVE-2024-31033 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-31033?
CVE-2024-31033 is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm (The product uses a broken or risky cryptographic algorithm or protocol.).
How can I check Maven dependencies for CVE-2024-31033?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.jsonwebtoken'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r65j-6h5f-4f92",
  "modified" : "2024-04-03T14:52:58Z",
  "published" : "2024-04-01T03:30:38Z",
  "withdrawn" : "2024-04-03T14:52:58Z",
  "aliases" : [ "CVE-2024-31033" ],
  "summary" : "Withdrawn: JJWT improperly generates signing keys",
  "details" : "## Withdrawn Advisory\n\nThis advisory has been withdrawn because it has been found to be disputed. Please see the issue [here](https://github.com/jwtk/jjwt/issues/930#issuecomment-2032699358) for more information.\n\n## Original Description\n\nJJWT (aka Java JWT) through 0.12.5 ignores certain characters and thus a user might falsely conclude that they have a strong key. The impacted code is the setSigningKey() method within the DefaultJwtParser class and the signWith() method within the DefaultJwtBuilder class.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.jsonwebtoken:jjwt-impl"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.12.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-31033"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jwtk/jjwt/issues/930#issuecomment-2032699358"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/2308652512/JJWT_BUG"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jwtk/jjwt"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jwtk/jjwt/blob/26948610fbef81eba867cbaad54b516d1874c70a/impl/src/main/java/io/jsonwebtoken/impl/DefaultJwtParserBuilder.java#L242"
  }, {
    "type" : "WEB",
    "url" : "https://www.viralpatel.net/java-create-validate-jwt-token"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-327" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-01T16:28:49Z",
    "nvd_published_at" : "2024-04-01T02:15:07Z"
  }
}