Skip to content

bcrypt-3.1.11.gem: 1 vulnerabilities (highest severity is: 6.7) #37

Description

@mend-for-github-com
Vulnerable Library - bcrypt-3.1.11.gem

bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for safely handling passwords.

Library home page: https://rubygems.org/gems/bcrypt-3.1.11.gem

Sample Path to Dependency File: /Gemfile.lock

Path to vulnerable library: /tmp/containerbase/cache/.ruby/cache/bcrypt-3.1.11.gem

Found in HEAD commit: ab21a9f862ff3da3db0787ca394d129f490c3cfe

Vulnerabilities

Vulnerability Severity CVSS Exploit Maturity EPSS Dependency Type Fixed in (bcrypt version) Remediation Possible** Reachability
CVE-2026-33306 Medium 6.7 Not Defined 0.228% bcrypt-3.1.11.gem Direct bcrypt - 3.1.22

**In some cases, Remediation PR cannot be created automatically for a vulnerability despite the availability of remediation

Details

CVE-2026-33306

Vulnerable Library - bcrypt-3.1.11.gem

bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for safely handling passwords.

Library home page: https://rubygems.org/gems/bcrypt-3.1.11.gem

Sample Path to Dependency File: /Gemfile.lock

Path to vulnerable library: /tmp/containerbase/cache/.ruby/cache/bcrypt-3.1.11.gem

Dependency Hierarchy:

  • bcrypt-3.1.11.gem (Vulnerable Library)

Found in HEAD commit: ab21a9f862ff3da3db0787ca394d129f490c3cfe

Found in base branch: main

Vulnerability Details

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.
Mend Note: The description of this vulnerability differs from MITRE.

Publish Date: 2026-03-24

URL: CVE-2026-33306

Threat Assessment

Exploit Maturity: Not Defined

EPSS: 0.228%

CVSS 3 Score Details (6.7)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Local
    • Attack Complexity: High
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-f27w-vcwj-c954

Release Date: 2026-03-19

Fix Resolution: bcrypt - 3.1.22

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions