mirror of
https://github.com/github/codeql.git
synced 2026-03-01 13:23:49 +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.
12 lines
568 B
Java
12 lines
568 B
Java
import org.apache.sshd.client.SshClient;
|
|
import org.apache.sshd.client.session.AbstractClientSession;
|
|
import java.io.IOException;
|
|
|
|
public class HardcodedApacheSshdCredentials {
|
|
public static void main(SshClient client, AbstractClientSession session) {
|
|
// BAD: Hardcoded credentials used for the session username and/or password.
|
|
client.connect("Username", "hostname", 22); // $ HardcodedCredentialsApiCall
|
|
client.connect("Username", null); // $ HardcodedCredentialsApiCall
|
|
session.addPasswordIdentity("password"); // $ HardcodedCredentialsApiCall
|
|
}
|
|
} |