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.
| Package | Affected versions | Patched versions |
|---|---|---|
net-ldapRubyGems | < 0.16.2 | 0.16.2 |
Affected products
2- ruby-net-ldap/ruby-net-ldapv5Range: 0.16.2
Patches
1b412ca05f6b4Use SecureRandam to generate salt
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- github.com/advisories/GHSA-qwgm-mxm4-3q2cghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2014-0083ghsaADVISORY
- bugzilla.redhat.com/show_bug.cgighsax_refsource_MISCWEB
- bugzilla.suse.com/show_bug.cgighsax_refsource_MISCWEB
- github.com/ruby-ldap/ruby-net-ldap/commit/b412ca05f6b430eaa1ce97ac95885b4cf187b04aghsax_refsource_CONFIRMWEB
- security-tracker.debian.org/tracker/CVE-2014-0083ghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.