T09 · Insecure Skill Coding Practices
- Location
index.js:72- Finding
SSH Server Identity Is Not Verified in the Primary Connection
- Content
View full analysis
Vulnerability Details
File Location:
index.js:72-80
Vulnerability Type: Missing SSH host-key verification
Risk Level: Highjs client.connect({ host: this.config.host, port: this.config.port, username: this.config.username, password: this.config.password, privateKey, passphrase: this.config.passphrase, keepaliveInterval: this.config.keepaliveInterval, readyTimeout: this.config.timeout });Technical Analysis
The primary SSH connection does not configure
hostVerifieror otherwise validate the server's host-key fingerprint against a trusted value. SSH encryption without server identity verification does not prevent an attacker who can redirect or intercept the connection from impersonating the configured server.This is particularly significant because the connection can carry passwords, administrative commands, command output, uploaded files, and downloaded files. The private key itself is not transmitted to the server, but the resulting SSH session can still be intercepted or manipulated when the endpoint is not authenticated.
Attack Path
- A user configures the Skill to connect to an SSH server.
- An attacker capable of DNS poisoning, routing manipulation, or network interception redirects the connection.
- The attacker presents an arbitrary SSH host key.
- Because the client does not compare that key with a trusted fingerprint, the connection can proceed to the attacker-controlled endpoint.
- The attacker can capture password authentication, observe submitted commands and data, return forged output, or manipulate file transfers.
Impact Assessment
Successful exploitation can compromise the confidentiality and integrity of the SSH session. The attacker may obtain a configured password, access transferred files, observe sensitive command output, or influence remote automation decisions by returning falsified results. The effective scope includes al ...[truncated 64 chars]
- Remediation
View remediation
Remediation Suggestions
- Require a trusted SHA-256 host-key fingerprint or known-hosts entry in the connection configuration.
- Configure
ssh2'shostVerifiercallback to compare the received host key against that trusted value using a constant-time comparison where applicable. - Fail closed if no trusted host key is available rather than silently accepting an unknown server.
- Provide an explicit, clearly labeled development-only option if first-use enrollment is required.
- Apply the same verification policy to every SSH connection path in the project.
- Add tests confirming that connections with unknown or changed host keys are rejected.
