CVE-2023-51774: Json jwt Json-jwt Allows Bypass Of Identity Vulnerability

MODERATE
Advisory Identifier: GHSA-c8v6-786g-vjx6
Published
Advisory Summary

CVE-2023-51774 is a MODERATE json-jwt allows bypass of identity vulnerability (General Security Weakness) affecting Json jwt libraries in the RubyGems ecosystem. The issue involves json-jwt allows bypass of identity checks via a sign/encryption confusion attack. Remediation is available by upgrading affected packages to version 1.16.6, 1.15.3.1.

CVE-2023-51774 at a Glance

CVE Identifier CVE-2023-51774
GHSA Identifier GHSA-c8v6-786g-vjx6
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Json jwt
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2023-51774

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

json-jwt fixed: 1.16.6
Upgrade json-jwt to 1.16.6
json-jwt fixed: 1.15.3.1
Upgrade json-jwt to 1.15.3.1
Verify Direct and Transitive Dependencies

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

inspect dependencies for json-jwt

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-51774, inspect your project dependencies for Json jwt:

inspect dependencies for json-jwt

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

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Json jwt, 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

The json-jwt (aka JSON::JWT) gem 1.16.x before 1.16.6, 1.15.x before 1.15.3.1 for Ruby sometimes allows bypass of identity checks via a sign/encryption confusion attack. For example, JWE can sometimes be used to bypass JSON::JWT.decode.

CVE-2023-51774 Affected Json jwt Versions

2 component(s)
Fixed Versions:
1.16.61.15.3.1
Product / Package Ecosystem Affected Versions Fixed Version
json-jwt
RubyGems
≥ 1.16.0
< 1.16.6
1.16.6
json-jwt
RubyGems
< 1.15.3.1
1.15.3.1

References

Frequently Asked Questions

What is CVE-2023-51774?
CVE-2023-51774 is a security vulnerability in Json jwt involving json-jwt allows bypass of identity checks via a sign/encryption confusion attack under General Security Weakness.
Which Json jwt versions are affected?
Affected versions include releases prior to 1.16.6, 1.15.3.1 across affected packages: json-jwt.
What version fixes CVE-2023-51774?
Upgrading to 1.16.6, 1.15.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is json-jwt affected?
Yes, json-jwt is affected in releases prior to 1.16.6, 1.15.3.1. Upgrade your dependency to 1.16.6, 1.15.3.1 or later.
What CWE is associated with CVE-2023-51774?
CVE-2023-51774 is classified under General Security Weakness.
How can I check RubyGems dependencies for CVE-2023-51774?
Run the dependency tree command: 'inspect dependencies for json-jwt'. 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-c8v6-786g-vjx6",
  "modified" : "2024-03-06T23:50:38Z",
  "published" : "2024-02-29T03:33:14Z",
  "aliases" : [ "CVE-2023-51774" ],
  "summary" : "json-jwt allows bypass of identity checks via a sign/encryption confusion attack",
  "details" : "The json-jwt (aka JSON::JWT) gem 1.16.x before 1.16.6, 1.15.x before 1.15.3.1 for Ruby sometimes allows bypass of identity checks via a sign/encryption confusion attack. For example, JWE can sometimes be used to bypass JSON::JWT.decode.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "json-jwt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.16.0"
      }, {
        "fixed" : "1.16.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "json-jwt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.15.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-51774"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nov/json-jwt/issues/120"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nov/json-jwt/issues/121"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nov/json-jwt/commit/593ea8bcaf2629048bad8c036191f2da0a2e713c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nov/json-jwt/commit/9c4d842a9465bd7960570ca326c3de79b4abc9d0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/P3ngu1nW/CVE_Request/blob/main/novjson-jwt.md"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nov/json-jwt"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/json-jwt/CVE-2023-51774.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-01T16:56:21Z",
    "nvd_published_at" : "2024-02-29T01:42:05Z"
  }
}