Skip to main content

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
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

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

transport.py · PythonReported on line 6
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 client

What Skylos leaves alone

transport.py · Python
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 client

Why Skylos leaves it alone

The client rejects an unknown key and verifies known keys against its configured trust store.

More languages

Go

Flagged

transport.go · GoReported on line 6
package app import "golang.org/x/crypto/ssh" func settings() *ssh.ClientConfig {    return &ssh.ClientConfig{HostKeyCallback: ssh.InsecureIgnoreHostKey()}}

Not flagged

transport.go · Go
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

  1. In Python, resolves the Paramiko client and policy through supported aliases and helper arguments. Reports AutoAddPolicy and WarningPolicy on set_missing_host_key_policy.
  2. 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.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.