The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-33306

CVE-2026-33306: bcrypt-ruby Privilege Escalation Flaw

CVE-2026-33306 is a privilege escalation vulnerability in bcrypt-ruby for JRuby caused by integer overflow at cost 31, reducing password hashing to zero iterations. This article covers technical details, affected versions, and fixes.

Published: March 27, 2026

CVE-2026-33306 Overview

CVE-2026-33306 is an integer overflow vulnerability in the Java BCrypt implementation for JRuby within the bcrypt-ruby gem. The vulnerability occurs when the cost parameter is set to 31, causing the key-strengthening round count to overflow from a positive value to a negative value. This results in zero iterations of the strengthening loop, effectively collapsing bcrypt's exponential key-strengthening from 2^31 rounds to near-constant-time computation.

Critical Impact

Password hashes generated with cost=31 appear valid ($2a$31$...) and verify correctly via checkpw, making the weakness invisible to the application while providing virtually no cryptographic protection.

Affected Products

  • bcrypt-ruby versions prior to 3.1.22 (JRuby implementation)
  • Applications using JRuby with bcrypt-ruby configured with cost=31
  • Systems verifying password hashes with $2a$31$ prefix

Discovery Timeline

  • 2026-03-18 - bcrypt-ruby team releases version 3.1.22 with security fix
  • 2026-03-24 - CVE-2026-33306 published to NVD
  • 2026-03-24 - Last updated in NVD database

Technical Details for CVE-2026-33306

Vulnerability Analysis

This vulnerability stems from the JRuby implementation of bcrypt-ruby (BCrypt.java) computing the key-strengthening round count as a signed 32-bit integer. The bcrypt algorithm uses a cost factor to determine how many rounds of key-strengthening to perform, calculated as 2^cost iterations. When the cost is set to 31 (the maximum allowed), the calculation 1 << 31 in a signed 32-bit integer context produces -2147483648 (negative due to overflow) instead of the intended 2147483648 positive value.

Since the strengthening loop condition checks i < rounds, a negative round count causes the loop to execute zero iterations. Only the initial EksBlowfish key setup and the final 64x encryption phase remain, drastically reducing the computational cost of password hashing and verification.

Root Cause

The root cause is CWE-190 (Integer Overflow or Wraparound). In Java, the int type is a signed 32-bit integer with a maximum value of 2^31 - 1 (2,147,483,647). When computing 1 << 31, the result exceeds this maximum and wraps around to -2147483648. The loop for (i = 0; i < rounds; i++) never executes because 0 < -2147483648 evaluates to false.

Attack Vector

The attack vector is local, requiring an attacker to either:

  1. Compromise password hashes from a system using JRuby bcrypt-ruby with cost=31
  2. Target verification of existing $2a$31$ hashes

Since the weakened hashes are computationally trivial to brute-force compared to properly strengthened bcrypt hashes, an attacker with access to the hash database could crack passwords in a fraction of the expected time. The vulnerability is particularly insidious because the generated hashes appear valid and verify correctly, leaving no indication to the application that the security guarantee has been compromised.

java
// Vulnerable code in BCrypt.java
// Source: https://github.com/bcrypt-ruby/bcrypt-ruby/commit/831ce64cb0a9502130fa93a28bfd9527a5fa45c4

 	*/
 	private byte[] crypt_raw(byte password[], byte salt[], int log_rounds,
 							boolean sign_ext_bug, int safety) {
-		int rounds, i, j;
+		long rounds;
+		int i, j;
 		int cdata[] =  bf_crypt_ciphertext.clone();
 		int clen = cdata.length;
 		byte ret[];

 		if (log_rounds < 4 || log_rounds > 31)
 			throw new IllegalArgumentException ("Bad number of rounds");
-		rounds = 1 << log_rounds;
+		rounds = roundsForLogRounds(log_rounds);
 		if (salt.length != BCRYPT_SALT_LEN)
 			throw new IllegalArgumentException ("Bad salt length");

 		init_key();
 		ekskey(salt, password, sign_ext_bug, safety);
-		for (i = 0; i < rounds; i++) {
+		for (long r = 0; r < rounds; r++) {
 			key(password, sign_ext_bug, safety);
 			key(salt, false, safety);
 		}

The fix changes rounds from int to long (64-bit) and uses a dedicated method roundsForLogRounds() to properly compute the round count, ensuring the value remains positive for all valid cost values.

Detection Methods for CVE-2026-33306

Indicators of Compromise

  • Password hashes in the database with the $2a$31$ prefix indicate potential exposure
  • JRuby applications running bcrypt-ruby versions prior to 3.1.22
  • BCrypt configuration explicitly setting cost=31 in authentication modules
  • Unusually fast password hashing/verification times when cost is configured as 31

Detection Strategies

  • Audit application configuration files for BCrypt cost settings equal to 31
  • Query password hash storage for entries beginning with $2a$31$ to identify affected credentials
  • Review dependency manifests (Gemfile.lock) for bcrypt-ruby versions below 3.1.22
  • Implement timing analysis to detect anomalously fast bcrypt operations

Monitoring Recommendations

  • Monitor authentication system logs for bcrypt cost configuration changes
  • Set up alerts for bcrypt-ruby gem version changes in deployment pipelines
  • Implement hash format validation to flag $2a$31$ hashes during routine security scans
  • Track password verification timing to detect potential integer overflow conditions

How to Mitigate CVE-2026-33306

Immediate Actions Required

  • Upgrade bcrypt-ruby to version 3.1.22 or later immediately
  • Audit existing password hashes for $2a$31$ prefix and force password resets for affected accounts
  • Review BCrypt cost configuration and reduce cost to 30 or below as an interim measure
  • Inventory all JRuby applications using bcrypt-ruby to assess exposure

Patch Information

The vulnerability has been fixed in bcrypt-ruby version 3.1.22, released on March 18, 2026. The fix modifies the BCrypt.java file to use a long type for the rounds variable instead of int, preventing the integer overflow condition.

Patch resources:

  • GitHub Release v3.1.22
  • GitHub Security Advisory GHSA-f27w-vcwj-c954
  • GitHub Commit Details

Workarounds

  • Set the BCrypt cost parameter to a value less than 31 (recommended: 12-14 for production systems)
  • Implement application-level validation to reject cost values of 31
  • Consider switching to MRI Ruby implementation if JRuby upgrade is not immediately feasible
  • Force password resets for any accounts with $2a$31$ hashes
bash
# Configuration example
# In your Ruby application, ensure cost is set below 31
# Example bcrypt configuration:
BCrypt::Engine.cost = 12  # Recommended default cost

# Audit for affected hashes in database:
# SELECT * FROM users WHERE password_hash LIKE '$2a$31$%';

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechBcrypt Ruby

  • SeverityMEDIUM

  • CVSS Score4.5

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:U/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-190
  • Technical References
  • GitHub Commit Details

  • GitHub Release v3.1.22

  • GitHub Security Advisory GHSA-f27w-vcwj-c954
  • Latest CVEs
  • CVE-2025-70797: LimeSurvey XSS Vulnerability

  • CVE-2025-30650: Juniper Junos OS Auth Bypass Vulnerability

  • CVE-2026-35471: Goshs Path Traversal Vulnerability

  • CVE-2026-35393: Goshs Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English