VYPR
Moderate severityNVD Advisory· Published Nov 21, 2019· Updated Aug 6, 2024

CVE-2014-0083

CVE-2014-0083

Description

The Ruby net-ldap gem before 0.11 uses a weak salt when generating SSHA passwords.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

The Ruby net-ldap gem before version 0.11 used a weak salt generated from rand() when creating SSHA password hashes, making them susceptible to brute-force attacks.

Vulnerability

Overview

The Ruby net-ldap gem (also known as Net::LDAP) prior to version 0.11 implemented SSHA (salted SHA1) password hashing using a weak salt. In the generate method of the password hash module, the salt was generated by calling srand; salt = (rand * 16).to_i.to_s [4]. This approach used the built-in rand() function seeded with srand, which produces a predictable sequence of pseudo-random numbers and a very small salt space of at most 16 possible values (0–15). This violates security best practices for password storage, where salts must be both unique and unpredictable to prevent precomputation attacks.

Attack

Vector and Exploitation

The vulnerability is present in the SSHA password generation code path within the gem. An attacker who gains access to the stored password hashes (e.g., via a database breach or LDAP server compromise) can exploit the weak salt. Because the salt is limited to a small numeric range, the attacker can precompute a rainbow table or dictionary for each of the 16 possible salt values. For each hash, the attacker iterates through possible salts and computes candidate SHA1 digests until a match is found. This dramatically reduces the computational effort required to recover plaintext passwords compared to proper salted hashing.

Impact

Successful exploitation allows an attacker to recover passwords from SSHA hashes with significantly less effort than would be required with a strong, random salt. The weak salt undermines the primary security property of SSHA: protection against precomputed dictionary and rainbow table attacks. This could lead to unauthorized access to systems that rely on net-ldap for LDAP authentication, especially if users reuse passwords across services.

Mitigation

The issue was fixed in net-ldap version 0.11 by changing the salt generation to use SecureRandom.random_bytes(16) [4], which provides 128 bits of cryptographically strong randomness. Users should upgrade to net-ldap 0.11 or later. Debian security tracker notes that packages in stable releases (bullseye and later) contain the fixed version [3]. Systems that generated SSHA hashes with the vulnerable code should rotate all affected passwords, as previously generated hashes remain weak even after upgrading.

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
net-ldapRubyGems
< 0.16.20.16.2

Affected products

2
  • ghsa-coords
    Range: < 0.16.2
  • ruby-net-ldap/ruby-net-ldapv5
    Range: 0.16.2

Patches

1
b412ca05f6b4

Use SecureRandam to generate salt

https://github.com/ruby-ldap/ruby-net-ldapTatsuya SatoJan 6, 2015via ghsa
1 file changed · +1 1
  • lib/net/ldap/password.rb+1 1 modified
    @@ -27,7 +27,7 @@ def generate(type, str)
           when :sha
              attribute_value = '{SHA}' + Base64.encode64(Digest::SHA1.digest(str)).chomp! 
           when :ssha
    -         srand; salt = (rand * 1000).to_i.to_s 
    +         srand; salt = SecureRandom.random_bytes(16)
              attribute_value = '{SSHA}' + Base64.encode64(Digest::SHA1.digest(str + salt) + salt).chomp!
           else
              raise Net::LDAP::HashTypeUnsupportedError, "Unsupported password-hash type (#{type})"
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.