...
See recommendation MEM06-C. Ensure that sensitive data is not written out to disk.
While using a password, consider storing its hash instead of plaintext. Use the hash for comparisons and other purposes. The following code \ [[Viega 2001|AA. Bibliography#Viega 01] \] illustrates this:Wiki Markup
| Code Block | ||||
|---|---|---|---|---|
| ||||
int validate(char *username) {
char *password;
char *checksum;
password = read_password();
checksum = compute_checksum(password);
erase(password); /* securely erase password */
return !strcmp(checksum, get_stored_checksum(username));
}
|
...
- Be aware of compiler optimization when erasing memory. (See recommendation MSC06-C. Be aware of compiler optimization when dealing with sensitive data.)unmigrated-wiki-markup
- Use secure erase methods specified in US Department of Defense Standard 5220 \ [[DOD 5220|AA. Bibliography#DOD 5220] \] or Peter Gutmann's paper \ [[Gutmann 1996|AA. Bibliography#Gutmann 96]\].
Risk Assessment
If sensitive data is not handled correctly in a program, an attacker can gain access to it.
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
MSC18-C | medium | probable | medium | P8 | L2 |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...
MITRE CWE: CWE-311, "Missing Encryption of Sensitive Data"
Bibliography
\[[DOD 5220|AA. Bibliography#DOD 5220]\]
\[Wiki Markup
[Gutmann 1996|AA. Bibliography#Gutmann 96]\]
\[[Lewis 2006|AA. Bibliography#Lewis 06]\]
\[[Viega 2001|AA. Bibliography#Viega 01]\]
[Lewis 2006]
[Viega 2001]
...