T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:246
- Finding
- Host-Key Verification Disabled in SSH Configuration Example<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 246–247 **Vulnerability Type**: Unsafe SSH host-key verification configuration **Risk Level**: High ### Vulnerable Code ```bash # Override config options ssh -o "StrictHostKeyChecking=no" myserver ``` ### Technical Analysis The example disables SSH host-key verification without an adjacent warning or safer alternative. `StrictHostKeyChecking=no` allows SSH to continue when the presented host key has not been independently trusted. Depending on other SSH options and existing `known_hosts` state, it can also permit connections despite host-key inconsistencies. Host-key verification is the principal SSH control that authenticates the remote server. Disabling it weakens protection against DNS spoofing, malicious network gateways, compromised routing infrastructure, and man-in-the-middle attacks. Although other sections of the document warn against this option, this configuration example is directly copyable and lacks equivalent context. Users may therefore adopt the unsafe setting as a normal override. ### Attack Path 1. A user copies the documented command to connect to `myserver`. 2. An attacker gains a position on the network path or manipulates DNS resolution for the server. 3. The attacker presents an attacker-controlled SSH host key. 4. Because strict host-key checking is disabled, the SSH client may proceed without requiring trusted host authentication. 5. The user interacts with the attacker's SSH endpoint under the belief that it is the intended server. 6. Commands, uploaded files, and passwords entered during the session may be disclosed to the attacker. ### Impact Assessment This does not directly grant local administrative privileges or disclose the user's private SSH key. However, a successful server-impersonation attack can expose: - Passwords entered during the fraudulent session - Commands and sensitive command output - Files uploaded to the impersonated server - Opera ...[truncated 285 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions Remove the unsafe example or replace it with a secure default: ```bash ssh -o StrictHostKeyChecking=accept-new myserver ``` Add explicit guidance that: - `accept-new` accepts previously unseen hosts but rejects changed keys. - `yes` should be used when the host key has already been securely provisioned. - `no` should not be presented as a routine connection or troubleshooting option. - Unexpected host-key changes must be investigated and verified through a trusted, independent channel. If the unsafe mode must remain for exceptional diagnostic scenarios, place a prominent warning immediately before the command and state that it must only be used in an isolated, controlled environment where server identity is verified by another mechanism. ]]>
