SKY-D380 · Security in code
SSH host-key verification disabled
Skylos reports SSH client settings that accept unknown host keys. It recognizes Paramiko policies in Python and host-key callbacks from Go's SSH package.
- Languages
- Python, Go
- Quality gate
- counted toward the gate limits (full and diff scans)
- Finding type
- review
Why it matters
A client that accepts unknown host keys cannot reliably verify the identity of the SSH server. This can expose application data and remote operations to an impersonating endpoint.
What Skylos flags
import paramiko def create_client(known_hosts): client = paramiko.SSHClient() client.load_host_keys(known_hosts) client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) return clientWhat Skylos leaves alone
import paramiko def create_client(known_hosts): client = paramiko.SSHClient() client.load_host_keys(known_hosts) client.set_missing_host_key_policy(paramiko.RejectPolicy()) return clientWhy Skylos leaves it alone
The client rejects an unknown key and verifies known keys against its configured trust store.
More languages
Go
Flagged
package app import "golang.org/x/crypto/ssh" func settings() *ssh.ClientConfig { return &ssh.ClientConfig{HostKeyCallback: ssh.InsecureIgnoreHostKey()}}Not flagged
package app import "golang.org/x/crypto/ssh" func settings(pinned ssh.PublicKey) *ssh.ClientConfig { return &ssh.ClientConfig{HostKeyCallback: ssh.FixedHostKey(pinned)}}Why Skylos leaves it alone
The callback only accepts the trusted public key supplied to the configuration.
How Skylos decides
- In Python, resolves the Paramiko client and policy through supported aliases and helper arguments. Reports AutoAddPolicy and WarningPolicy on set_missing_host_key_policy.
- In Go, checks a resolved golang.org/x/crypto/ssh ClientConfig literal or field assignment for InsecureIgnoreHostKey. The Go engine resolves supported aliases within the same package.
How to fix it
Use a trusted known_hosts file or verify a pinned host key. Keep Paramiko's default RejectPolicy or configure Go's knownhosts callback.
When it can be wrong
- A development fixture can intentionally accept temporary SSH keys. Keep that setting in the fixture and verify that it cannot reach production.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Mark the reviewed line with a rule-scoped Skylos ignore for SKY-D380. Record the evidence that justifies the exception.