Back to skill

Security audit

dist-deploy

Security checks for vulnerabilities and agentic risk

Overview

This deployment skill needs review because unsafe command quoting and incomplete failure recovery could run unintended commands or leave a site offline.

Fix Bash parameter quoting, deployment failure recovery and the manual example before production use. Use a restricted deployment account, verify the destination and hook, and keep independent backups. Fresh mode deletes the previous release, and retention removes older backups. All bundled files were inspected, but no live-server deployment or recovery was tested.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The atomicity portion is valid: moving the existing release aside and then moving the new release into place leaves the serving path temporarily absent, potentially indefinitely if the second move fails. The other allegations overreach because the literal settings belong to examples, and a simplified manual equivalent need not implement every script option.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The chunk contains no artifact packaging, transfer, release swap, backup management, or ownership correction. Nginx validation and reload could support a deployment hook, but the supplied code only performs that maintenance operation and does not expose it as a configurable hook. Its literal SSH destination and port also contradict the declared parameterization.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| Windows (PowerShell 7+) | `scripts/deploy-dist.ps1` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| macOS / Linux | `scripts/deploy-dist.sh` |

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

bash
bash <SKILL_DIR>/scripts/deploy-dist.sh -s ./dist -H deploy@host -p 2222 \
  -k ~/.ssh/id_ed25519 -t /opt/app/dist -o www-data:www-data \
  -c "nginx -t && systemctl reload nginx"

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/deploy-dist.ps1 (reported line 10)May include surrounding context.

text
./deploy-dist.ps1 -Source .\dist -Server root@192.0.2.10 -Target /var/www/app/dist

.EXAMPLE
    ./deploy-dist.ps1 -Source .\dist -Server deploy@host -Port 2222 -Key ~/.ssh/id_ed25519 `
        -Target /opt/app/dist -Owner www-data:www-data -PostCommand "systemctl reload nginx"
#>
[CmdletBinding()]

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/deploy-dist.sh (reported line 3)May include surrounding context.

sh
#!/usr/bin/env bash
# deploy-dist.sh - 通用构建产物远程部署(打包 -> SCP -> 远程原子替换)
# 用法: ./deploy-dist.sh -s ./dist -H user@host -t /var/www/app/dist [-p 22] [-k ~/.ssh/id_ed25519]
#                      [-o www-data:www-data] [-c "systemctl reload nginx"] [-n 3] [-f] [-d]
set -euo pipefail

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

The script prints backup: /opt/app/dist.bak.20261102153000. Restore it with:

bash
ssh -p 22 user@host 'rm -rf /opt/app/dist && mv /opt/app/dist.bak.20261102153000 /opt/app/dist'

Then reload whatever serves it:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

The script prints backup: /opt/app/dist.bak.20261102153000. Restore it with:

bash
ssh -p 22 user@host 'rm -rf /opt/app/dist && mv /opt/app/dist.bak.20261102153000 /opt/app/dist'

Then reload whatever serves it:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

bash
tar -czf /tmp/dist.tgz -C ./dist .
scp -P 2222 /tmp/dist.tgz root@host:/tmp/dist.tgz
ssh -p 2222 root@host 'set -e; rm -rf /opt/app/.deploy-tmp && mkdir -p /opt/app/.deploy-tmp && \
  tar -xzf /tmp/dist.tgz -C /opt/app/.deploy-tmp && \
  rm -rf /opt/app/dist.bak.prev && mv /opt/app/dist /opt/app/dist.bak.prev 2>/dev/null || true; \
  mv /opt/app/.deploy-tmp /opt/app/dist && rm -f /tmp/dist.tgz'

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

scp -P 2222 /tmp/dist.tgz root@host:/tmp/dist.tgz ssh -p 2222 root@host 'set -e; rm -rf /opt/app/.deploy-tmp && mkdir -p /opt/app/.deploy-tmp &&
tar -xzf /tmp/dist.tgz -C /opt/app/.deploy-tmp &&
rm -rf /opt/app/dist.bak.prev && mv /opt/app/dist /opt/app/dist.bak.prev 2>/dev/null || true;
mv /opt/app/.deploy-tmp /opt/app/dist && rm -f /tmp/dist.tgz'

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

bash
tar -czf /tmp/dist.tgz -C ./dist .
scp -P 2222 /tmp/dist.tgz root@host:/tmp/dist.tgz
ssh -p 2222 root@host 'set -e; rm -rf /opt/app/.deploy-tmp && mkdir -p /opt/app/.deploy-tmp && \
  tar -xzf /tmp/dist.tgz -C /opt/app/.deploy-tmp && \
  rm -rf /opt/app/dist.bak.prev && mv /opt/app/dist /opt/app/dist.bak.prev 2>/dev/null || true; \
  mv /opt/app/.deploy-tmp /opt/app/dist && rm -f /tmp/dist.tgz'

Chaining Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

The semicolon is not inherently abusive, but the surrounding command chain has a real fail-open error: the trailing '|| true' covers the preceding staging, extraction, and backup operations. Consequently, an extraction failure can be ignored despite 'set -e', and the final move may install incomplete content or move staging content into the existing release.

Content

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

bash
tar -czf /tmp/dist.tgz -C ./dist .
scp -P 2222 /tmp/dist.tgz root@host:/tmp/dist.tgz
ssh -p 2222 root@host 'set -e; rm -rf /opt/app/.deploy-tmp && mkdir -p /opt/app/.deploy-tmp && \
  tar -xzf /tmp/dist.tgz -C /opt/app/.deploy-tmp && \
  rm -rf /opt/app/dist.bak.prev && mv /opt/app/dist /opt/app/dist.bak.prev 2>/dev/null || true; \
  mv /opt/app/.deploy-tmp /opt/app/dist && rm -f /tmp/dist.tgz'

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

scp -P 2222 /tmp/dist.tgz root@host:/tmp/dist.tgz ssh -p 2222 root@host 'set -e; rm -rf /opt/app/.deploy-tmp && mkdir -p /opt/app/.deploy-tmp &&
tar -xzf /tmp/dist.tgz -C /opt/app/.deploy-tmp &&
rm -rf /opt/app/dist.bak.prev && mv /opt/app/dist /opt/app/dist.bak.prev 2>/dev/null || true;
mv /opt/app/.deploy-tmp /opt/app/dist && rm -f /tmp/dist.tgz'

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

ssh -p 2222 root@host 'set -e; rm -rf /opt/app/.deploy-tmp && mkdir -p /opt/app/.deploy-tmp &&
tar -xzf /tmp/dist.tgz -C /opt/app/.deploy-tmp &&
rm -rf /opt/app/dist.bak.prev && mv /opt/app/dist /opt/app/dist.bak.prev 2>/dev/null || true;
mv /opt/app/.deploy-tmp /opt/app/dist && rm -f /tmp/dist.tgz'

text

## Notes

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

ssh -p 2222 root@host 'set -e; rm -rf /opt/app/.deploy-tmp && mkdir -p /opt/app/.deploy-tmp &&
tar -xzf /tmp/dist.tgz -C /opt/app/.deploy-tmp &&
rm -rf /opt/app/dist.bak.prev && mv /opt/app/dist /opt/app/dist.bak.prev 2>/dev/null || true;
mv /opt/app/.deploy-tmp /opt/app/dist && rm -f /tmp/dist.tgz'

text

## Notes

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/deploy-dist.ps1 (reported line 81)May include surrounding context.

text
rm -rf "$NEW"
mkdir -p "$NEW"
tar -xzf "$ARCHIVE" -C "$NEW"
[ -n "$OWNER" ] && chown -R "$OWNER" "$NEW"

if [ "$MODE" = "fresh" ]; then
    rm -rf "$TGT"

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/deploy-dist.sh (reported line 54)May include surrounding context.

sh
rm -rf "$NEW"
mkdir -p "$NEW"
tar -xzf "$ARCHIVE" -C "$NEW"
[ -n "$OWNER" ] && chown -R "$OWNER" "$NEW"

if [ "$MODE" = "fresh" ]; then
    rm -rf "$TGT"

The included deployment sequence does not provide the atomic directory swap promised by the manifest.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The manual deployment uses two separate moves rather than an atomic exchange, leaving an interval when the application path does not exist. A failure after the first move can prolong the outage, which matters for a utility advertised as safely replacing live deployments.

Content

No source excerpt is available for this finding.

The advertised atomic directory swap is implemented as separate removal and replacement operations.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Both deployment modes remove the current serving path before installing its replacement: fresh mode deletes it, while backup mode renames it away. A failure or interruption before the final move leaves the application unavailable, and the exit cleanup can delete the staged replacement without restoring the old release.

Content

No source excerpt is available for this finding.

The claimed atomic deployment is implemented as separate removal and replacement operations.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The script removes or renames the live deployment before moving the replacement into place, leaving a window where the target does not exist. If interrupted or the final move fails, the service remains unavailable; fresh mode also permanently removes the previous release. This is particularly consequential for a deployment tool advertised as providing an atomic swap.

Content

No source excerpt is available for this finding.

Permanent deletion of the current deployment and older backups is not disclosed.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

Fresh mode deletes the existing target without creating a backup, and normal mode silently deletes backups beyond the retention limit. Although deployment and replacement are documented, neither the usage comments nor runtime messages explain these irreversible deletions or their effect on rollback availability.

Content

No source excerpt is available for this finding.