CVE-2019-18848

7.5 HIGH

📋 TL;DR

This vulnerability in the json-jwt Ruby gem allows improper authentication due to missing element count validation when splitting JWE strings. Attackers could potentially bypass authentication mechanisms or manipulate JWT tokens. Any Ruby application using json-jwt versions before 1.11.0 for JWE processing is affected.

💻 Affected Systems

Products:
  • json-jwt Ruby gem
Versions: All versions before 1.11.0
Operating Systems: All operating systems running Ruby
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using JWE (JSON Web Encryption) functionality of the gem.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete authentication bypass allowing unauthorized access to protected resources or systems.

🟠

Likely Case

Authentication bypass in specific JWE implementations leading to unauthorized data access.

🟢

If Mitigated

Limited impact with proper token validation and additional authentication layers.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires understanding of JWE structure and access to JWT tokens.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.11.0

Vendor Advisory: https://github.com/nov/json-jwt/commit/ada16e772906efdd035e3df49cb2ae372f0f948a

Restart Required: Yes

Instructions:

1. Update Gemfile to require 'json-jwt', '>= 1.11.0'
2. Run 'bundle update json-jwt'
3. Restart application server
4. Test JWE functionality

🔧 Temporary Workarounds

Disable JWE functionality

all

Temporarily disable JSON Web Encryption features if not required

# Modify application code to avoid JWE usage

🧯 If You Can't Patch

  • Implement additional token validation layers
  • Monitor authentication logs for suspicious JWE usage patterns

🔍 How to Verify

Check if Vulnerable:

Check Gemfile.lock or run 'bundle show json-jwt' and verify version is < 1.11.0

Check Version:

ruby -e "require 'json/jwt'; puts JSON::JWT::VERSION"

Verify Fix Applied:

Confirm json-jwt version is >= 1.11.0 and test JWE parsing functionality

📡 Detection & Monitoring

Log Indicators:

  • Failed JWE parsing attempts
  • Unusual authentication patterns with JWT tokens

Network Indicators:

  • Unexpected JWE token usage in authentication requests

SIEM Query:

source=application_logs AND (message="*JWE*" OR message="*json-jwt*") AND severity=ERROR

🔗 References

📤 Share & Export