☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-0306

CVE-2025-0306 Supply Chain Attack in Ruby
📅 PUBLISHED: 2025-01-09 04:05 UTC 🔄 UPDATED: 2026-10-14 23:34 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.65%
👁️
0.65% probability
16.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: USA License: Commercial
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
7.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-0306 identifies a vulnerability in the Ruby interpreter that makes it susceptible to the Marvin Attack. The Marvin Attack is a cryptographic side-channel attack targeting RSA-based protocols, specifically PKCS#1 v1.5 padding. By exchanging a large number of messages with a vulnerable service, an attacker can decrypt previously encrypted ciphertexts or forge signatures. This vulnerability undermines the confidentiality and integrity of communications relying on Ruby's RSA implementation. The attack exploits timing or other side-channel differences in the handling of RSA ciphertexts, allowing an attacker to recover the plaintext or create valid signatures without the private key.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Ruby is a widely used programming language, and its standard library includes cryptographic functions. This vulnerability affects any application or service that uses Ruby's OpenSSL bindings for RSA decryption or signature verification with PKCS#1 v1.5 padding. The impact is broad, as many Ruby gems and frameworks (e.g., Rails, Devise, OmniAuth) rely on these cryptographic operations for secure communication, authentication, and data protection. An attacker exploiting this vulnerability could compromise encrypted sessions, forge authentication tokens, or decrypt sensitive data. Organizations using Ruby in their supply chain must assess their exposure and apply patches or mitigations as soon as they become available.

CVSS Breakdown & Threat Level

The CVSS score is listed as 0.0, which is likely a placeholder or unassigned value. Based on the nature of the Marvin Attack, the actual CVSS score would be high, typically around 7.5-8.0, due to the following factors:

  • Attack Vector (AV): Network (N) – The attack is performed over the network.
  • Attack Complexity (AC): High (H) – The attack requires a large number of messages and precise timing measurements.
  • Privileges Required (PR): None (N) – No authentication is needed.
  • User Interaction (UI): None (N) – No user action is required.
  • Scope (S): Unchanged (U) – The vulnerability does not affect other components.
  • Confidentiality (C): High (H) – Decryption of encrypted data is possible.
  • Integrity (I): High (H) – Signature forgery is possible.
  • Availability (A): None (N) – The attack does not affect availability.

Threat Level: High. The Marvin Attack is a well-known cryptographic attack, and its application to Ruby's RSA implementation poses a significant risk to data confidentiality and integrity.

Deep Dive & Mechanics

The Marvin Attack is a variant of the Bleichenbacher attack, which exploits the PKCS#1 v1.5 padding scheme in RSA. The attack works by sending a large number of carefully crafted ciphertexts to a server and observing the server's responses (e.g., error messages, timing differences) to determine whether the padding is valid. Over many iterations, the attacker can narrow down the possible values of the plaintext and eventually recover the entire message.

In the context of Ruby, the vulnerability likely resides in the OpenSSL bindings or the underlying implementation of RSA decryption. The Ruby interpreter may not properly implement constant-time operations or may leak information through error messages or timing variations when processing RSA ciphertexts with PKCS#1 v1.5 padding.

Key Mechanics:

  1. The attacker intercepts an RSA-encrypted message (ciphertext).
  2. The attacker sends modified versions of the ciphertext to the Ruby service.
  3. The service attempts to decrypt each modified ciphertext using its private key.
  4. Based on the service's response (e.g., "padding error" vs. "success"), the attacker learns information about the plaintext.
  5. After thousands to millions of queries, the attacker can recover the original plaintext or forge a valid signature.

Vulnerable vs. Patched Code

Since no patch is currently available, the vulnerable code is any Ruby version that uses OpenSSL's RSA decryption with PKCS#1 v1.5 padding. The patched code would involve implementing constant-time RSA decryption, disabling PKCS#1 v1.5 padding, or using a different padding scheme (e.g., OAEP).

Vulnerable Code Example (Ruby):

require 'openssl'

private_key = OpenSSL::PKey::RSA.new(2048)
ciphertext = ... # encrypted data
plaintext = private_key.private_decrypt(ciphertext, OpenSSL::PKey::RSA::PKCS1_PADDING)

Patched Code Example (Hypothetical):

require 'openssl'

private_key = OpenSSL::PKey::RSA.new(2048)
ciphertext = ... # encrypted data
# Use OAEP padding instead of PKCS#1 v1.5
plaintext = private_key.private_decrypt(ciphertext, OpenSSL::PKey::RSA::OAEP_PADDING)

Exploitation & Lab Setup

Red Team (Attacker)

Objective: Decrypt an RSA-encrypted message or forge a signature using the Marvin Attack against a Ruby service.

Lab Setup:

  1. Target: A Ruby application that uses RSA decryption with PKCS#1 v1.5 padding (e.g., a simple HTTPS server or an API endpoint).
  2. Attacker Machine: Kali Linux with Python and necessary libraries (e.g., pycryptodome, requests).
  3. Network: Both machines on the same network (e.g., local VM network).

Exploitation Steps:

  1. Intercept Ciphertext: Capture an RSA-encrypted message (e.g., a session key) from the target.
  2. Craft Modified Ciphertexts: Use a script to generate modified versions of the ciphertext.
  3. Send Queries: Send each modified ciphertext to the target and observe the response (e.g., HTTP status code, response time).
  4. Analyze Responses: Use the responses to narrow down the plaintext possibilities.
  5. Recover Plaintext: After sufficient queries, recover the original plaintext.

Example Script (Python):

import requests
from cryptography.hazmat.primitives.asymmetric import rsa, padding
from cryptography.hazmat.primitives import serialization, hashes
import base64

# Target URL
url = "https://target.com/decrypt"

# Intercepted ciphertext (base64 encoded)
ciphertext_b64 = "base64_encoded_ciphertext"
ciphertext = base64.b64decode(ciphertext_b64)

# Marvin Attack implementation (simplified)
# This is a placeholder for the actual attack logic
def marvin_attack(ciphertext, oracle):
    # Oracle function returns True if padding is valid, False otherwise
    # Implement the Bleichenbacher/Marvin algorithm here
    pass

# Example oracle function
def oracle(modified_ciphertext):
    response = requests.post(url, data={"ciphertext": base64.b64encode(modified_ciphertext)})
    # Assume the server returns "success" for valid padding
    return "success" in response.text

# Run attack
plaintext = marvin_attack(ciphertext, oracle)
print("Recovered plaintext:", plaintext)

Blue Team (Defender)

Objective: Detect and mitigate the Marvin Attack against Ruby services.

Detection:

  1. Monitor for Anomalous Traffic: Look for a high volume of requests to RSA decryption endpoints from a single IP address.
  2. Analyze Error Rates: A sudden increase in "padding error" responses may indicate an attack.
  3. Use Timing Analysis: Detect unusual timing patterns in RSA decryption operations.

Mitigation:

  1. Disable PKCS#1 v1.5 Padding: Use OAEP padding instead.
  2. Implement Rate Limiting: Limit the number of decryption requests per IP address.
  3. Add Logging: Log all RSA decryption attempts and alert on anomalies.
  4. Apply Patches: Once a patch is available, update Ruby immediately.

Indicators of Compromise (IOCs)

  • Network Traffic: High volume of POST requests to endpoints handling RSA decryption (e.g., /decrypt, /api/decrypt).
  • Error Logs: Repeated "padding error" or "decryption failed" messages in server logs.
  • Timing Anomalies: Unusual response times for RSA decryption operations (e.g., consistent delays).
  • Source IPs: Single or small set of IP addresses making a large number of decryption requests.

Detection Engineering

YARA Rule

rule CVE_2025_0306_Marvin_Attack {
    meta:
        description = "Detects Ruby code vulnerable to Marvin Attack (PKCS#1 v1.5 padding)"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2025-0306"
    strings:
        $s1 = "PKCS1_PADDING" nocase
        $s2 = "private_decrypt" nocase
        $s3 = "RSA" nocase
    condition:
        all of ($s1, $s2, $s3)
}

Sigma Rule

title: CVE-2025-0306 - Marvin Attack Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects potential Marvin Attack attempts against Ruby RSA decryption endpoints
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
    service: access_log
detection:
    selection:
        cs-method: 'POST'
        cs-uri-stem:
            - '/decrypt'
            - '/api/decrypt'
            - '/rsa/decrypt'
    condition: selection
falsepositives:
    - Legitimate high-volume decryption requests
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-0306 - Potential Marvin Attack"; flow:to_server; content:"POST"; http_method; content:"/decrypt"; http_uri; threshold: type both, track by_src, count 100, seconds 60; sid:1000001; rev:1;)

Remediation & Mitigation

  1. Immediate Actions:

    • Disable PKCS#1 v1.5 padding in Ruby's RSA implementation and switch to OAEP padding.
    • Implement rate limiting on RSA decryption endpoints.
    • Monitor logs for anomalous decryption requests.
  2. Long-term Fix:

    • Apply the official patch from Ruby once released.
    • Update all dependencies that rely on Ruby's RSA implementation.
    • Conduct a security audit of cryptographic operations in your Ruby applications.
  3. Workarounds:

    • Use a different cryptographic library (e.g., rbnacl for NaCl-based encryption).
    • Implement constant-time RSA decryption in custom code.
  4. Detection:

    • Deploy the provided YARA, Sigma, and Suricata rules.
    • Set up alerts for high volumes of decryption requests.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-0306/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.