@@ -8,6 +8,7 @@ public static void main(String[] args) throws SQLException {
8
8
String url = "jdbc:mysql://localhost/test" ;
9
9
String usr = "admin" ; // hard-coded user name (flow source)
10
10
String pass = "123456" ; // hard-coded password (flow source)
11
+ String pwd = "myPassword" ; // hard-coded password (flow source)
11
12
12
13
test (url , usr , pass ); // flow through method
13
14
@@ -26,12 +27,18 @@ public static void main(String[] args) throws SQLException {
26
27
passwordCheck (pass ); // $ HardcodedCredentialsSourceCall
27
28
}
28
29
29
- public static void test (String url , String user , String password ) throws SQLException {
30
- DriverManager .getConnection (url , user , password ); // $ HardcodedCredentialsApiCall
30
+ public static void test (String url , String user , String v ) throws SQLException {
31
+ DriverManager .getConnection (url , user , v ); // $ HardcodedCredentialsApiCall
31
32
}
32
33
33
34
public static final String password = "myOtherPassword" ; // $ HardcodedPasswordField
34
35
36
+ public static final String pwd = "myOtherPassword" ; // $ HardcodedPasswordField
37
+
38
+ public static final String hard_coded_passphrase_chars = "MyPassPhrase" ; // $ HardcodedPasswordField
39
+
40
+ public static final String password_question = "What is your password?" ; // Good: not a password
41
+
35
42
public static boolean passwordCheck (String password ) {
36
43
return password .equals ("admin" ); // $ HardcodedCredentialsComparison
37
44
}
0 commit comments