agnivade easy-scrypt scrypt.go VerifyPassphrase timing discrepancy
Description
A vulnerability, which was classified as problematic, was found in agnivade easy-scrypt. Affected is the function VerifyPassphrase of the file scrypt.go. The manipulation leads to observable timing discrepancy. The complexity of an attack is rather high. The exploitability is told to be difficult. Upgrading to version 1.0.0 is able to address this issue. The name of the patch is 477c10cf3b144ddf96526aa09f5fdea613f21812. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-217596.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/agnivade/easy-scryptGo | < 1.0.0 | 1.0.0 |
Affected products
1- Range: n/a
Patches
1477c10cf3b14Preventing timing attacks
1 file changed · +7 −2
scrypt.go+7 −2 modified@@ -4,6 +4,7 @@ import ( "bytes" "crypto/rand" "crypto/sha256" + "crypto/subtle" "encoding/binary" "log" @@ -117,8 +118,12 @@ func VerifyPassphrase(passphrase string, keylen_bytes int, target_key []byte) (r } source_hash := hash_digest.Sum(nil) - result = bytes.Equal(source_master_key, target_master_key) && - bytes.Equal(target_hash, source_hash) + // ConstantTimeCompare returns ints. Converting it to bool + key_comp := subtle.ConstantTimeCompare(source_master_key, + target_master_key) != 0 + hash_comp := subtle.ConstantTimeCompare(target_hash, + source_hash) != 0 + result = key_comp && hash_comp return }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/agnivade/easy-scrypt/commit/477c10cf3b144ddf96526aa09f5fdea613f21812ghsapatchWEB
- github.com/agnivade/easy-scrypt/releases/tag/v1.0.0ghsapatchWEB
- github.com/advisories/GHSA-r894-5r7v-7rx3ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2014-125055ghsaADVISORY
- vuldb.comghsasignaturepermissions-requiredWEB
- vuldb.comghsavdb-entrytechnical-descriptionWEB
News mentions
0No linked articles in our index yet.