@@ -8,14 +8,17 @@ <h2>Why is this an issue?</h2>
88 < li > < a href ="https://www.cve.org/CVERecord?id=CVE-2019-13466 "> CVE-2019-13466</ a > </ li >
99 < li > < a href ="https://www.cve.org/CVERecord?id=CVE-2018-15389 "> CVE-2018-15389</ a > </ li >
1010</ ul >
11+ < p > This rule also examines the credential value itself: a value that is recognizable as something other than a real credential is not reported, even
12+ when the variable name or the connection string parameter matches one of the configured words. Placeholders, references to an environment variable or
13+ to a secrets manager, encrypted values, and obvious example or test values are therefore not flagged.</ p >
1114< h2 > How to fix it</ h2 >
1215< p > Credentials should be stored in a configuration file that is not committed to the code repository, in a database, or managed by your cloud
1316provider’s secrets management service. If a password is exposed in the source code, it must be changed immediately.</ p >
1417< h3 > Code Examples</ h3 >
1518< h4 > Noncompliant code example</ h4 >
1619< pre data-diff-id ="1 " data-diff-type ="noncompliant ">
1720String username = "steve";
18- String password = "blue ";
21+ String password = "Xk9mP2vL8qR4 ";
1922Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test?" +
2023 "user=" + username + "&password=" + password); // Noncompliant
2124</ pre >
@@ -30,7 +33,7 @@ <h2>Resources</h2>
3033< ul >
3134 < li > OWASP - < a href ="https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/ "> Top 10 2021 Category A7 - Identification and
3235 Authentication Failures</ a > </ li >
33- < li > OWASP - < a href ="https://owasp.org/www-project-top-ten/ 2017/A2_2017-Broken_Authentication "> Top 10 2017 Category A2 - Broken
36+ < li > OWASP - < a href ="https://github.com/OWASP/Top10/blob/master/ 2017/en/0xa2-broken-authentication.md "> Top 10 2017 Category A2 - Broken
3437 Authentication</ a > </ li >
3538 < li > CWE - < a href ="https://cwe.mitre.org/data/definitions/798 "> CWE-798 - Use of Hard-coded Credentials</ a > </ li >
3639 < li > CWE - < a href ="https://cwe.mitre.org/data/definitions/259 "> CWE-259 - Use of Hard-coded Password</ a > </ li >
0 commit comments