-
Notifications
You must be signed in to change notification settings - Fork 0
/
CA5373.yaml
31 lines (27 loc) · 873 Bytes
/
CA5373.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
rules:
- id: CA5373
languages: [csharp]
severity: WARNING
metadata:
cwe: 'CWE-477: Use of Obsolete Function'
references:
- https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5373
category: security
message: |
Do not use obsolete key derivation function
Password-based key derivation should use the PBKDF2 algorithm with SHA-2 hashing. Rfc2898DeriveBytes.GetBytes can be used to achieve that.
patterns:
- pattern-inside: |
using System;
using System.Security.Cryptography;
...
class $C
{
public void TestMethod(Rfc2898DeriveBytes $X, ...)
{
...
}
}
- pattern-either:
- pattern: |
$X.CryptDeriveKey(...);