GHSA-f27w-vcwj-c954 · Severity: medium · Ecosystem: rubygems — bcrypt-ruby has an Integer Overflow that Causes Zero Key-Strengthening Iterations at Cost=31 on JRuby
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.
Conclusion & alert: CVE-2026-33306 is rated Low Risk (18.2/100): CVSS Medium severity, with low exploitation likelihood (EPSS 0.01%). Mandatory action: Low composite risk—no urgent action required; patch on your normal maintenance cycle and revisit priority if CVSS or EPSS increases.
Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.
EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).
| # | Date | Old EPSS score | New EPSS score | Delta (New - Old) |
|---|---|---|---|---|
| 1 | 2026-03-24 | — | 0.01% | — |
Full EPSS history (1 record total)
CVSS metrics for this CVE.
| Base score | Version | Severity | Vector | Exploitability | Impact | Score source |
|---|---|---|---|---|---|---|
| 4.5 | 4.0 | MEDIUM |
|
— | — | [email protected] |
| 7.5 | 3.1 | HIGH |
|
3.9 | 3.6 | [email protected] |
GHSA-f27w-vcwj-c954 · Severity: medium · Ecosystem: rubygems — bcrypt-ruby has an Integer Overflow that Causes Zero Key-Strengthening Iterations at Cost=31 on JRuby
| vendor | priority | summary | link |
|---|---|---|---|
debian
|
not yet assigned | CVE-2026-33306 not yet assigned priority: Debian including 1 source packages (ruby-bcrypt), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): open 3, resolved 2. | https://security-tracker.debian.org/tracker/CVE-2026-33306 |
redhat
|
medium | — | https://access.redhat.com/security/cve/CVE-2026-33306 |
ubuntu
|
medium | CVE-2026-33306 medium priority: Ubuntu including 1 source packages (bcrypt), 6 status rows across 6 suites (bionic, jammy, noble, questing, upstream, xenial): DNE 3, needs-triage 3. | https://ubuntu.com/security/CVE-2026-33306 |
| Vendor | Product | Version | Raw CPE |
|---|---|---|---|
| bcrypt-ruby_project | bcrypt-ruby | < 3.1.22 | cpe:2.3:a:bcrypt-ruby_project:bcrypt-ruby:*:*:*:*:*:ruby:*:* |
| URL | Tags |
|---|---|
| https://github.com/bcrypt-ruby/bcrypt-ruby/commit/831ce64cb0a9502130fa93a28bfd9527a5fa45c4 | Patch |
| https://github.com/bcrypt-ruby/bcrypt-ruby/releases/tag/v3.1.22 | Product Release Notes |
| https://github.com/bcrypt-ruby/bcrypt-ruby/security/advisories/GHSA-f27w-vcwj-c954 | Mitigation Vendor Advisory |