You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @name Use of obsolete Key Derivation Function (KDF) algorithm
3
-
* @description Using obsolete or weak KDF algorithms like PasswordDeriveBytes (PBKDF1)
4
-
* instead of secure alternatives like Rfc2898DeriveBytes (PBKDF2) can
5
-
* compromise password security.
3
+
* @description Do not use obsolete or weak KDF algorithms like PasswordDeriveBytes (PBKDF1)
4
+
* instead of secure alternatives like Rfc2898DeriveBytes (PBKDF2)
6
5
* @kind problem
7
6
* @problem.severity error
8
7
* @security-severity 7.5
@@ -25,34 +24,21 @@ class CryptDeriveKeyCall extends DataFlow::CallNode {
25
24
this= API::getTopLevelMember("system")
26
25
.getMember("security")
27
26
.getMember("cryptography")
28
-
.getMember("passwordderivebytes")
27
+
.getMember("passwordderivebytes").getInstance()
29
28
.getMember("cryptderivekey")
30
29
.asCall()
31
30
or
32
31
this= API::getTopLevelMember("system")
33
32
.getMember("security")
34
33
.getMember("cryptography")
35
-
.getMember("rfc2898derivebytes")
34
+
.getMember("rfc2898derivebytes").getInstance()
36
35
.getMember("cryptderivekey")
37
36
.asCall()
38
37
}
39
38
}
40
39
41
-
// from DataFlow::CallNode cn
42
-
// where
43
-
// cn instanceof CryptDeriveKeyCall
44
-
// select cn, "Use of obsolete Crypto API. Consider using Rfc2898DeriveBytes (PBKDF2) or a more modern alternative like Argon2."
40
+
from DataFlow::CallNodecn
41
+
where
42
+
cninstanceofCryptDeriveKeyCall
43
+
selectcn,"Use of obsolete Crypto API. Password-based key derivation should use the PBKDF2 algorithm with SHA-2 hashing"
45
44
46
-
// from DataFlow::CallNode cn
47
-
// select cn, "cn"
48
-
// from CryptDeriveKeyCall cn
49
-
// select cn, "Use of obsolete KDF algorithm PasswordDeriveBytes (PBKDF1). Consider using Rfc2898DeriveBytes (PBKDF2) or a more modern alternative like Argon2."
<li>NIST, SP 800-131A: <ahref="https://csrc.nist.gov/publications/detail/sp/800-131a/rev-2/final">Transitioning the Use of Cryptographic Algorithms and Key Lengths</a>.</li>
<li>NIST, FIPS 197: <ahref="https://csrc.nist.gov/publications/detail/fips/197/final">Advanced Encryption Standard (AES)</a>.</li>
51
+
<li>NIST, SP 800-131A: <ahref="https://csrc.nist.gov/publications/detail/sp/800-131a/rev-2/final">Transitioning the Use of Cryptographic Algorithms and Key Lengths</a>.</li>
52
+
<li>OWASP: <ahref="https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#rule---use-strong-approved-authenticated-encryption">Rule - Use strong approved cryptographic algorithms</a>.</li>
53
+
<li>CWE-327: <ahref="https://cwe.mitre.org/data/definitions/327.html">Use of a Broken or Risky Cryptographic Algorithm</a>.</li>
0 commit comments