Back to skill

Security audit

Hxd Deploy

Security checks for vulnerabilities and agentic risk

Overview

This deployment skill is understandable in purpose, but it can automatically make privileged production changes using root SSH access with weak connection verification and no clear confirmation gate.

Install only if you intend an agent to deploy this exact HXD service to the listed server. Before use, replace root login with a dedicated deployment account and key, enable strict host-key verification, remove broad automatic triggers, and require an explicit confirmation showing the target host, artifact path/checksum, backup name, and service restart action before any remote mutation.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
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, and SKILL.md:155
Vulnerability Type: Insecure SSH configuration permitting server impersonation
Risk Level: High

Vulnerable 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=no option instructs the SSH client to accept an unverified host key instead of requiring the remote server to match a trusted key in known_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=no from every SSH and SCP command.

  • Provision the production server's verified public host key in a dedicated known_hosts file 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.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:20
Finding

Deployment authenticates as unrestricted root using the user's default SSH key

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:20-22, SKILL.md:58, SKILL.md:65, SKILL.md:71-76, SKILL.md:80, SKILL.md:87-90, and SKILL.md:155
Vulnerability Type: Excessive remote privileges and violation of least privilege
Risk Level: High

Vulnerable Code

markdown
### Server Information
- **IP**: 203.170.59.16
- **User**: root
- **SSH Private Key**: `~/.ssh/id_ed25519`

The corresponding deployment operations use the root account directly:

powershell
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"

Technical Analysis

The declared functionality requires permission to upload one application artifact, rotate files in /hjxz/hxd-api/lib, restart one service, and read that service's status and logs. It does not inherently require an unrestricted interactive root account.

Authenticating directly as root gives every invoked SSH command system-wide administrative authority. In addition, the Skill selects the user's default id_ed25519 key rather than a dedicated deployment credential. A default personal key may be accepted by unrelated systems or accounts, increasing the potential scope if the local key or agent environment is compromised.

The document does not expose the private-key contents. Nevertheless, its credential usage exceeds the minimum privilege needed for the declared deployment task.

Attack Path

  1. An attacker compromises the workstation, execution agent, SSH ag ...[truncated 1077 chars]
Remediation
View remediation

Remediation Suggestions

  • Disable direct SSH login for root.
  • Create a dedicated account such as deploy-hxd with access restricted to the required application directories.
  • Use a separate SSH key generated exclusively for this deployment workflow rather than the user's default id_ed25519.
  • Restrict the key in the server's authorized_keys entry with controls such as source-address restrictions and, where practical, a forced deployment command.
  • Grant narrowly scoped sudo permissions only for the required service actions. Do not grant a general shell or unrestricted sudo.
  • Separate artifact upload from privileged activation: upload to a staging directory as the deployment user, validate the artifact, and use a controlled root-owned deployment script to perform the atomic replacement.
  • Make application files and scripts root-owned where appropriate so the deployment account cannot alter the service-management mechanism itself.
  • Rotate the existing credential if it has been broadly reused, and maintain an auditable inventory of every system that accepts it.
  • Log all deployments and privileged service actions with the initiating identity, artifact checksum, timestamp, and result.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:9
Finding

Broad automatic trigger can initiate a privileged production deployment without explicit target confirmation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:9-17
Vulnerability Type: Unsafe automatic execution configuration for a destructive deployment workflow
Risk Level: Medium

Vulnerable Code

markdown
## Trigger Conditions

Automatically trigger when the user mentions any of the following keywords:
- "Deploy Huoxiaoding"
- "Deploy hxd"
- "Deploy service"
- "Update Huoxiaoding"
- "Release Huoxiaoding"
- "hxd deployment"
- "Put Huoxiaoding online"

The original Skill text declares automatic activation on these phrases, including the generic phrase meaning “deploy service.” The selected workflow then targets the fixed server 203.170.59.16, replaces the active JAR, and restarts the service.

Technical Analysis

Deployment changes the state of a fixed remote server and can interrupt a production service. Such an operation should require clear identification of the target environment, artifact, and authorization to restart. The generic trigger does not distinguish an informational discussion from an instruction to modify production, and the Skill does not define a mandatory confirmation gate immediately before the upload, replacement, or restart.

This is especially risky when combined with the root SSH access configured elsewhere in the file. Trigger matching alone should not be treated as sufficient authorization for a privileged and potentially disruptive action.

Attack Path

  1. A user or untrusted text visible to the agent includes the generic deployment phrase.
  2. The Skill automatically activates and selects the hardcoded production server and artifact path.
  3. No mandatory confirmation step requires the operator to verify the environment, host, artifact checksum, deployment window, or restart authorization.
  4. The workflow builds and uploads the local JAR, replaces the active application, and restarts the service.
  5. An unintended artifact, wrong local workspace state, or unauth ...[truncated 485 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove generic automatic triggers such as “deploy service.”
  • Treat trigger matching only as permission to prepare a deployment plan, not permission to execute remote changes.
  • Require an explicit confirmation immediately before the first mutating remote operation.
  • Present the exact environment, host, artifact path, artifact checksum, current version, proposed version, and restart action in the confirmation prompt.
  • Use separate explicit commands for staging and production deployments.
  • Require stronger production authorization, such as an approval token, change-request identifier, or second-person approval.
  • Add preflight checks for artifact integrity, service health, free disk space, deployment window, and rollback readiness.
  • Stop automatically if the target or artifact differs from the approved values.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Referencing a specific SSH private key path as part of the skill operational flow indicates the agent may access sensitive authentication material to reach a remote root account. In context, this is dangerous because the skill couples credential use with automated remote deployment steps, creating a clear path to privileged server access if misused or accidentally triggered.

Content

Scanner excerpt · SKILL.md (reported line 26)May include surrounding context.

md
### 服务器信息
- **IP**: 203.170.59.16
- **用户**: root
- **SSH 私钥**: `~/.ssh/id_ed25519`

### 文件路径
- **本地 JAR**: `D:\springboot\hxd\target\hxd-0.0.1-SNAPSHOT.jar`

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill performs high-impact operations on a live server, including artifact replacement and service restart, without requiring an explicit warning or confirmation that production state will be changed and downtime may occur. In an agent setting, missing consent boundaries materially raises the risk of unintended operational damage.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrase “部署服务” is overly broad for a skill that performs production-affecting actions such as uploading artifacts and restarting a remote service. This increases the chance of accidental invocation during ordinary conversation, which could lead to unintended deployment or service disruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs use of a root account and an SSH private key for remote execution without prominently warning the user that privileged credentials will be accessed and commands will run as superuser. This combination makes any accidental trigger or misuse significantly more dangerous because it grants broad control over the target server.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description says the skill deploys the service by uploading a JAR, backing up the old version, and restarting the service. However, the documented procedure also performs a local mvn clean package build, which is a software build capability rather than a necessary part of remote deployment itself.

Content

No source excerpt is available for this finding.