Skip to content

Files

Latest commit

 

History

History
28 lines (19 loc) · 923 Bytes

B507.md

File metadata and controls

28 lines (19 loc) · 923 Bytes

Pattern: Missing host key validation

Issue: -

Description

Encryption in general is typically critical to the security of many applications. Using SSH can greatly increase security by guaranteeing the identity of the party you are communicating with. This is accomplished by one or both parties presenting trusted host keys during the connection initialization phase of SSH.

When paramiko methods are used, host keys are verified by default. If host key verification is disabled, Bandit will return a HIGH severity error.

Example:

from paramiko import client

ssh_client = client.SSHClient()
ssh_client.set_missing_host_key_policy(client.AutoAddPolicy)
ssh_client.set_missing_host_key_policy(client.WarningPolicy)

Further Reading