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
Copy file name to clipboardExpand all lines: rust/ql/src/queries/security/CWE-798/HardcodedCryptographicValue.qhelp
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -5,38 +5,38 @@
5
5
6
6
<overview>
7
7
<p>
8
-
Hardcoded passwords, keys, initialization vectors, and salts should not be used for cryptographic operations.
8
+
Hard-coded passwords, keys, initialization vectors, and salts should not be used for cryptographic operations.
9
9
</p>
10
10
<ul>
11
11
<li>
12
-
Attackers can easily recover hardcoded values if they have access to the source code or compiled executable.
12
+
Attackers can easily recover hard-coded values if they have access to the source code or compiled executable.
13
13
</li>
14
14
<li>
15
-
Some hardcoded values are easily guessable.
15
+
Some hard-coded values are easily guessable.
16
16
</li>
17
17
<li>
18
-
Use of hardcoded values may leave cryptographic operations vulnerable to dictionary attacks, rainbow tables, and other forms of cryptanalysis.
18
+
Use of hard-coded values may leave cryptographic operations vulnerable to dictionary attacks, rainbow tables, and other forms of cryptanalysis.
19
19
</li>
20
20
</ul>
21
21
22
22
</overview>
23
23
<recommendation>
24
24
25
25
<p>
26
-
Use randomly generated key material, initialization vectors, and salts. Use strong passwords that are not hardcoded.
26
+
Use randomly generated key material, initialization vectors, and salts. Use strong passwords that are not hard-coded.
27
27
</p>
28
28
29
29
</recommendation>
30
30
<example>
31
31
32
32
<p>
33
-
The following example shows instantiating a cipher with hardcoded key material, making the encrypted data vulnerable to recovery.
33
+
The following example shows instantiating a cipher with hard-coded key material, making the encrypted data vulnerable to recovery.
34
34
</p>
35
35
36
36
<samplesrc="HardcodedCryptographicValueBad.rs" />
37
37
38
38
<p>
39
-
In the fixed code below, the key material is randomly generated and not hardcoded, which protects the encrypted data against recovery. A real application would also need a strategy for secure key management after the key has been generated.
39
+
In the fixed code below, the key material is randomly generated and not hard-coded, which protects the encrypted data against recovery. A real application would also need a strategy for secure key management after the key has been generated.
0 commit comments