T09 · Insecure Skill Coding Practices
- Location
SKILL.md:58- Finding
SSH host identity verification is disabled for all deployment operations
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:58,SKILL.md:65,SKILL.md:71-76,SKILL.md:80,SKILL.md:87-90, andSKILL.md:155
Vulnerability Type: Insecure SSH configuration permitting server impersonation
Risk Level: HighVulnerable Code
powershell ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 "echo 'SSH connection successful'"powershell $timestamp = Get-Date -Format "yyyy-MM-dd-HH-mm" scp -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no "D:\springboot\hxd\target\hxd-0.0.1-SNAPSHOT.jar" "root@203.170.59.16:/hjxz/hxd-api/lib/hxd-0.0.1-SNAPSHOT.jar"powershell ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 @" cd /hjxz/hxd-api/lib mv hxd.jar hxd.jar.bak$timestamp mv hxd-0.0.1-SNAPSHOT.jar hxd.jar "@powershell ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 "/hjxz/hxd-api/bin/hxd-api restart"powershell ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 "cat /hjxz/hxd-api/bin/hxd-api.status" ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 "tail -30 /hjxz/hxd-api/logs/wrapper.log"powershell ssh -i "$env:USERPROFILE\.ssh\id_ed25519" -o StrictHostKeyChecking=no root@203.170.59.16 @" cd /hjxz/hxd-api/lib ls -lt hxd.jar.bak* | head -1 | awk '{print \$NF}' | xargs -I {} cp {} hxd.jar /hjxz/hxd-api/bin/hxd-api restart "@Technical Analysis
The
StrictHostKeyChecking=nooption instructs the SSH client to accept an unverified host key instead of requiring the remote server to match a trusted key inknown_hosts. Public-key authentication verifies the client to the server, but it does not protect the client when server identity verification is disabled.Accessing an SSH private key is relevant to th ...[truncated 1611 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove
-o StrictHostKeyChecking=nofrom every SSH and SCP command. -
Provision the production server's verified public host key in a dedicated
known_hostsfile before deployment. -
Require strict verification explicitly, for example:
powershell ssh -i "$env:USERPROFILE\.ssh\hxd_deploy_ed25519" ` -o StrictHostKeyChecking=yes ` -o UserKnownHostsFile="$env:USERPROFILE\.ssh\hxd_known_hosts" ` deploy-hxd@203.170.59.16 "command" -
Obtain and verify the host-key fingerprint through a separate trusted channel before adding it.
-
Treat unexpected host-key changes as deployment failures requiring operator review rather than automatically accepting the new key.
-
Apply the same strict host-key policy to connection tests, uploads, replacements, restarts, status checks, log retrieval, and rollback.
-
