bcrypt-ruby up to 3.1.21 on JRuby BCrypt.java integer overflow

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
4.3$0-$5k0.00

Summaryinfo

A vulnerability has been found in bcrypt-ruby up to 3.1.21 on JRuby and classified as problematic. The impacted element is an unknown function of the file BCrypt.java. This manipulation causes integer overflow. The identification of this vulnerability is CVE-2026-33306. The attack can only be executed locally. There is no exploit available. The affected component should be upgraded.

Detailsinfo

A vulnerability has been found in bcrypt-ruby up to 3.1.21 on JRuby and classified as problematic. Affected by this vulnerability is an unknown part of the file BCrypt.java. The manipulation with an unknown input leads to a integer overflow vulnerability. The CWE definition for the vulnerability is CWE-190. The product performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control. As an impact it is known to affect confidentiality, integrity, and availability. The summary by CVE is:

bcrypt-ruby is a Ruby binding for the OpenBSD bcrypt() password hashing algorithm. Prior to version 3.1.22, an integer overflow in the Java BCrypt implementation for JRuby can cause zero iterations in the strengthening loop. Impacted applications must be setting the cost to 31 to see this happen. The JRuby implementation of bcrypt-ruby (`BCrypt.java`) computes the key-strengthening round count as a signed 32-bit integer. When `cost=31` (the maximum allowed by the gem), signed integer overflow causes the round count to become negative, and the strengthening loop executes **zero iterations**. This collapses bcrypt from 2^31 rounds of exponential key-strengthening to effectively constant-time computation — only the initial EksBlowfish key setup and final 64x encryption phase remain. The resulting hash looks valid (`$2a$31$...`) and verifies correctly via `checkpw`, making the weakness invisible to the application. This issue is triggered only when cost=31 is used or when verifying a `$2a$31$` hash. This problem has been fixed in version 3.1.22. As a workaround, set the cost to something less than 31.

It is possible to read the advisory at github.com. This vulnerability is known as CVE-2026-33306 since 03/18/2026. The exploitation appears to be difficult. Attacking locally is a requirement. Technical details of the vulnerability are known, but there is no available exploit.

The vulnerability scanner Nessus provides a plugin with the ID 303306 (Linux Distros Unpatched Vulnerability : CVE-2026-33306), which helps to determine the existence of the flaw in a target environment.

Upgrading to version 3.1.22 eliminates this vulnerability. The upgrade is hosted for download at github.com. Applying the patch 831ce64cb0a9502130fa93a28bfd9527a5fa45c4 is able to eliminate this problem. The bugfix is ready for download at github.com. The best possible mitigation is suggested to be upgrading to the latest version.

The vulnerability is also documented in the vulnerability database at Tenable (303306). Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Productinfo

Type

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔒
VulDB Reliability: 🔍

CNA CVSS-B Score: 🔒
CNA CVSS-BT Score: 🔒
CNA Vector: 🔒

CVSSv3info

VulDB Meta Base Score: 4.5
VulDB Meta Temp Score: 4.3

VulDB Base Score: 4.5
VulDB Temp Score: 4.3
VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍

Exploitinginfo

Class: Integer overflow
CWE: CWE-190 / CWE-189
CAPEC: 🔒
ATT&CK: 🔒

Physical: Partially
Local: Yes
Remote: No

Availability: 🔒
Status: Not defined

EPSS Score: 🔒
EPSS Percentile: 🔒

Price Prediction: 🔍
Current Price Estimation: 🔒

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 303306
Nessus Name: Linux Distros Unpatched Vulnerability : CVE-2026-33306

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔒

Upgrade: bcrypt-ruby 3.1.22
Patch: 831ce64cb0a9502130fa93a28bfd9527a5fa45c4

Timelineinfo

03/18/2026 CVE reserved
03/24/2026 +6 days Advisory disclosed
03/24/2026 +0 days VulDB entry created
03/28/2026 +4 days VulDB entry last update

Sourcesinfo

Product: github.com

Advisory: GHSA-f27w-vcwj-c954
Status: Confirmed

CVE: CVE-2026-33306 (🔒)
GCVE (CVE): GCVE-0-2026-33306
GCVE (VulDB): GCVE-100-352579

Entryinfo

Created: 03/24/2026 02:26
Updated: 03/28/2026 09:37
Changes: 03/24/2026 02:26 (72), 03/24/2026 03:53 (2), 03/28/2026 09:37 (2)
Complete: 🔍
Cache ID: 216:C8F:103

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you need the next level of professionalism?

Upgrade your account now!