CVE-2023-51774
Ruby vulnerability analysis and mitigation

Overview

The json-jwt (aka JSON::JWT) gem version 1.16.3 for Ruby contains a vulnerability that allows bypass of identity checks through a sign/encryption confusion attack. The vulnerability was discovered in late 2023 and affects applications using the JSON::JWT.decode functionality (GitHub PoC).

Technical details

The vulnerability exists in the JSON::JWT.decode function which automatically determines whether a token belongs to JWS (JSON Web Signature) or JWE (JSON Web Encryption). When developers use RS-* signing algorithms and an attacker has access to the public key, a sign/encryption confusion attack becomes possible. This occurs because the decoder fails to properly validate the token type, allowing JWE tokens to bypass checks intended for JWS tokens (GitHub PoC).

Impact

The vulnerability could allow attackers to bypass identity checks and authentication mechanisms in applications using the affected json-jwt gem version. This could potentially lead to unauthorized access and privilege escalation in affected systems (NVD).

Exploitability

The vulnerability requires the attacker to have access to the public key used for RS-* signing algorithms. With this prerequisite met, an attacker can craft specially formatted JWE tokens to bypass the intended security checks in the JSON::JWT.decode function (GitHub PoC).

Mitigation and workarounds

Users of the json-jwt gem should upgrade to a version newer than 1.16.3 when available. Until then, additional validation should be implemented to explicitly verify token types before processing (NVD).

Additional resources


SourceThis report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-50276HIGH7.5
  • Ruby logoRuby
  • datadog
NoYesSep 14, 2026
CVE-2026-70658HIGH7.4
  • Ruby logoRuby
  • pay
NoNoSep 14, 2026
CVE-2026-44163MEDIUM5.3
  • Ruby logoRuby
  • fluent-plugin-opentelemetry
NoYesSep 15, 2026
CVE-2026-44282MEDIUM4.8
  • Ruby logoRuby
  • decidim-elections
NoYesSep 15, 2026
CVE-2026-44162LOW2.7
  • Ruby logoRuby
  • ruby4.0-fluent-plugin-s3
NoYesSep 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management