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
* Improved performance of alias analysis of large function bodies. In rare cases, alerts that depend on alias analysis of large function bodies may be affected.
Copy file name to clipboardExpand all lines: cpp/ql/src/Security/CWE/CWE-311/CleartextStorage.inc.qhelp
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,15 +19,20 @@ cleartext.</p>
19
19
<example>
20
20
21
21
<p>The following example shows two ways of storing user credentials in a file. In the 'BAD' case,
22
-
the credentials are simply stored in cleartext. In the 'GOOD' case, the credentials are encrypted before
22
+
the credentials are simply stored in cleartext. In the 'GOOD' case, the credentials are encrypted before
23
23
storing them.</p>
24
24
25
25
<samplesrc="CleartextStorage.c" />
26
26
27
+
<p>Note that for the 'GOOD' example to work we need to link against an encryption library (in this case libsodium),
28
+
initialize it with a call to <code>sodium_init</code>, and create the key and nonce with
29
+
<code>crypto_secretbox_keygen</code> and <code>randombytes_buf</code> respectively. We also need to store those
30
+
details securely so they can be used for decryption.</p>
31
+
27
32
</example>
28
33
<references>
29
34
30
-
<li>M. Dowd, J. McDonald and J. Schuhm, <i>The Art of Software Security Assessment</i>, 1st Edition, Chapter 2 - 'Common Vulnerabilities of Encryption', p. 43. Addison Wesley, 2006.</li>
35
+
<li>M. Dowd, J. McDonald and J. Schuhm, <i>The Art of Software Security Assessment</i>, 1st Edition, Chapter 2 - 'Common Vulnerabilities of Encryption', p. 43. Addison Wesley, 2006.</li>
31
36
<li>M. Howard and D. LeBlanc, <i>Writing Secure Code</i>, 2nd Edition, Chapter 9 - 'Protecting Secret Data', p. 299. Microsoft, 2002.</li>
0 commit comments