mirror of
https://github.com/github/codeql.git
synced 2026-03-01 05:13:41 +01:00
Specifically Apache sshd defines its sensitive api calls on an inherited interface, and they need to be described that way for us to pick them up.
13 lines
525 B
Java
13 lines
525 B
Java
import net.schmizz.sshj.SSHClient;
|
|
import java.io.IOException;
|
|
|
|
public class HardcodedSshjCredentials {
|
|
public static void main(SSHClient client) {
|
|
// BAD: Hardcoded credentials used for the session username and/or password.
|
|
try {
|
|
client.authPassword("Username", "password"); // $ HardcodedCredentialsApiCall $ HardcodedCredentialsSourceCall
|
|
client.authPassword("Username", "password".toCharArray()); // $ HardcodedCredentialsApiCall $ HardcodedCredentialsSourceCall
|
|
}
|
|
catch(IOException e) { }
|
|
}
|
|
} |