Back to skill

Security audit

huawei-cloud-flexus-l-deploy-jiuwenswarm

Security checks for vulnerabilities and agentic risk

Overview

This deployment skill needs review because it weakens credential protection, exposes model keys in deployment records, and enables automatic renewal without clearly disclosing it.

Before use, require fixes that preserve credential encryption, remove secret output and unnecessary secret copies, explicitly offer renewal choices, and protect existing installations with backups. Use scoped temporary credentials in an isolated environment without your normal hcloud configuration; environment variables alone do not bypass an existing profile. Restrict web access and protect it with TLS. Rotate keys if deployment output containing them has been shared. Cloud operations and downloaded dependencies were not executed during this review.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/utils.py
Finding

Credential discovery persistently disables existing CLI credential encryption

Content
View full analysis

Impact

When hcloud applies the requested change, credentials previously stored encrypted remain available in plaintext after the deployment workflow. This weakens protection against subsequent disclosure of that configuration file; it does not prove that another user can currently read it.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config_model.py
Finding

Model configuration copies the complete secret-bearing environment file into remote task output

Content
View full analysis

Impact

The full model credential and any other environment-file secrets become available wherever that task output is collected or retained. Actual access by an unauthorized principal was not demonstrated.

T09 · Insecure Skill Coding Practices

Warning
Location
assets/deploy_script_template.sh
Finding

Existing-instance deployment has destructive operations without enforced approval gates

Content
View full analysis

Impact

Existing model and channel configuration can be lost, and a running installation can be disrupted. The paths are fixed; this is not arbitrary-path deletion.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create_instance.py
Finding

Instance creation silently enables automatic renewal

Content
View full analysis

Impact

An accepted order may continue renewing and charging beyond the initial one-month purchase until the user disables renewal or releases the resource.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (75)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documentation explicitly says credential loading automatically disables encryption in the existing hcloud configuration. Although disclosed later in the document, this unnecessarily downgrades protection of stored cloud credentials and can expose powerful account access to anyone who subsequently obtains that file.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The command targets the expected cloud service, but performs instance deletion rather than creation, deployment, or configuration. Although it appears in troubleshooting documentation and could support cleanup, the supplied chunk does not restrict deletion to failed deployments or otherwise establish that context. This destructive lifecycle operation is not represented in the declared purpose.

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 179)May include surrounding context.

md
ated**, skip `create_instance.py` and deploy JiuwenSwarm directly onto it: run `install_deps.py` → `deploy_service.py` → `verify_deployment.py` → `config_model.

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 221)May include surrounding context.

md
python scripts/install_deps.py --ip <public_ip>

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
1. **Service bound to 0.0.0.0** (configured via `.env` `FRONTEND_HOST=0.0.0.0`)
2. **Security group allows port 5173** (configured in Huawei Cloud Console)

#### .env Configuration (Service-side)
The `.env` file at `/root/.jiuwenswarm/config/.env` must use the correct variable names:

| .env Variable        | Purpose              | Required Value |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

md
#### .env Configuration (Service-side)
The `.env` file at `/root/.jiuwenswarm/config/.env` must use the correct variable names:

| .env Variable        | Purpose              | Required Value |
| :------------------- | :------------------- | :------------- |
| `FRONTEND_HOST`      | Frontend HTTP bind   | `0.0.0.0`      |
| `FRONTEND_PORT`      | Frontend HTTP port   | `5173`         |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · assets/config_template.yaml (reported line 32)May include surrounding context.

yaml
client_secret: ""
    allow_from: "*"

# Model Configuration (read from .env file)
model:
  api_base: ${API_BASE}
  api_key: ${API_KEY}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · assets/deploy_script_template.sh (reported line 77)May include surrounding context.

sh
rate_limit: 100
CONFIGEOF

cat > /root/.jiuwenswarm/config/.env << 'ENVEOL'
API_BASE=https://api.openai.com/v1
API_KEY=your-api-key-here
MODEL_NAME=gpt-4

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/troubleshooting.md (reported line 54)May include surrounding context.

md
**Symptoms**: Cannot access http://{ip}:5173, connection refused or timeout.

**Root Cause A: .env variable name mismatch (port bound to 127.0.0.1)**

The service reads `FRONTEND_HOST` for host binding, NOT `JIUWENSWARM_HOST`. If the
wrong variable is used, the service defaults to `127.0.0.1` (localhost only).

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/troubleshooting.md (reported line 59)May include surrounding context.

md
The service reads `FRONTEND_HOST` for host binding, NOT `JIUWENSWARM_HOST`. If the
wrong variable is used, the service defaults to `127.0.0.1` (localhost only).

| .env Variable        | Default             | Required Value |
| :------------------- | :------------------ | :------------- |
| `FRONTEND_HOST`      | `localhost` (127.0.0.1) | `0.0.0.0`   |
| `FRONTEND_PORT`      | `5173`              | `5173`         |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/troubleshooting.md (reported line 75)May include surrounding context.

md
# Fix: update .env and restart
sed -i 's/^JIUWENSWARM_HOST=.*/FRONTEND_HOST=0.0.0.0/' /root/.jiuwenswarm/config/.env
sed -i 's/^JIUWENSWARM_PORT=.*/FRONTEND_PORT=5173/' /root/.jiuwenswarm/config/.env
echo -e "WEB_HOST=0.0.0.0\nAGENT_SERVER_HOST=0.0.0.0\nGATEWAY_HOST=0.0.0.0" >> /root/.jiuwenswarm/config/.env
systemctl restart jiuwenswarm && sleep 10
ss -tlnp | grep 5173  # verify 0.0.0.0

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/verify_deployment.py (reported line 91)May include surrounding context.

python
print_info(f"Instance ID: {instance_id}")
    print_info(f"Region: {region}")

    # Verification script - checks service status, .env config, port binding, and HTTP health
    verification_script = '''#!/bin/bash
echo "=== JiuwenSwarm Deployment Verification ==="
ALL_OK=true

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/verify_deployment.py (reported line 100)May include surrounding context.

python
echo "--- [1/4] Service Status ---"
systemctl is-active --quiet jiuwenswarm && echo "PASS: service running" || { echo "FAIL: service not running"; exit 1; }

# 2. .env FRONTEND_HOST check (required for external web access)
echo "--- [2/4] .env FRONTEND_HOST ---"
ENV_FILE="/root/.jiuwenswarm/config/.env"
if [ -f "$ENV_FILE" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/verify_deployment.py (reported line 101)May include surrounding context.

python
systemctl is-active --quiet jiuwenswarm && echo "PASS: service running" || { echo "FAIL: service not running"; exit 1; }

# 2. .env FRONTEND_HOST check (required for external web access)
echo "--- [2/4] .env FRONTEND_HOST ---"
ENV_FILE="/root/.jiuwenswarm/config/.env"
if [ -f "$ENV_FILE" ]; then
    if grep -q "^[[:space:]]*FRONTEND_HOST=0.0.0.0" "$ENV_FILE"; then

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · scripts/verify_deployment.py (reported line 110)May include surrounding context.

python
echo "FAIL: FRONTEND_HOST not set to 0.0.0.0 in .env"; ALL_OK=false
    fi
else
    echo "FAIL: .env file not found at $ENV_FILE"; ALL_OK=false
fi

# 3. Port binding (0.0.0.0 vs 127.0.0.1)

Credential loading disables hcloud credential encryption, an unjustified change to local security settings.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Automatically turning off credential encryption modifies a user's existing security settings merely to simplify credential loading. Persisting cloud secrets in plaintext increases the consequences of configuration-file disclosure, including through backups or local access.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · assets/deploy_script_template.sh (reported line 92)May include surrounding context.

sh
ENVEOL

chmod 600 /root/.jiuwenswarm/config/config.yaml
chmod 600 /root/.jiuwenswarm/config/.env


log_info "Installing Python 3.11"

Dependency Source Redirection

High
Category
Supply Chain
Confidence
100% confidence
Finding

Dependency resolution is redirected away from a canonical default, adds another source, or uses a destination that cannot be resolved statically.

Content

Scanner excerpt · assets/deploy_script_template.sh (reported line 119)May include surrounding context.

sh
pip install --upgrade pip setuptools wheel -q -i https://mirrors.aliyun.com/pypi/simple/

Dependency Source Redirection

High
Category
Supply Chain
Confidence
100% confidence
Finding

Dependency resolution is redirected away from a canonical default, adds another source, or uses a destination that cannot be resolved statically.

Content

Scanner excerpt · assets/deploy_script_template.sh (reported line 122)May include surrounding context.

sh
pip install jiuwenswarm -i https://mirrors.aliyun.com/pypi/simple/ --no-cache-dir

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · assets/deploy_script_template.sh (reported line 213)May include surrounding context.

sh
User=root
Group=root
WorkingDirectory=/opt/jiuwenswarm-env
EnvironmentFile=/root/.jiuwenswarm/config/.env
ExecStart=/opt/jiuwenswarm-env/bin/jiuwenswarm-start
Restart=always
RestartSec=5

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/troubleshooting.md (reported line 73)May include surrounding context.

md
# Check port binding — 127.0.0.1 means wrong, 0.0.0.0 means correct
ss -tlnp | grep 5173

# Fix: update .env and restart
sed -i 's/^JIUWENSWARM_HOST=.*/FRONTEND_HOST=0.0.0.0/' /root/.jiuwenswarm/config/.env
sed -i 's/^JIUWENSWARM_PORT=.*/FRONTEND_PORT=5173/' /root/.jiuwenswarm/config/.env
echo -e "WEB_HOST=0.0.0.0\nAGENT_SERVER_HOST=0.0.0.0\nGATEWAY_HOST=0.0.0.0" >> /root/.jiuwenswarm/config/.env

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/troubleshooting.md (reported line 74)May include surrounding context.

md
ss -tlnp | grep 5173

# Fix: update .env and restart
sed -i 's/^JIUWENSWARM_HOST=.*/FRONTEND_HOST=0.0.0.0/' /root/.jiuwenswarm/config/.env
sed -i 's/^JIUWENSWARM_PORT=.*/FRONTEND_PORT=5173/' /root/.jiuwenswarm/config/.env
echo -e "WEB_HOST=0.0.0.0\nAGENT_SERVER_HOST=0.0.0.0\nGATEWAY_HOST=0.0.0.0" >> /root/.jiuwenswarm/config/.env
systemctl restart jiuwenswarm && sleep 10

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/troubleshooting.md (reported line 76)May include surrounding context.

Fix: update .env and restart

sed -i 's/^JIUWENSWARM_HOST=./FRONTEND_HOST=0.0.0.0/' /root/.jiuwenswarm/config/.env sed -i 's/^JIUWENSWARM_PORT=./FRONTEND_PORT=5173/' /root/.jiuwenswarm/config/.env echo -e "WEB_HOST=0.0.0.0\nAGENT_SERVER_HOST=0.0.0.0\nGATEWAY_HOST=0.0.0.0" >> /root/.jiuwenswarm/config/.env systemctl restart jiuwenswarm && sleep 10 ss -tlnp | grep 5173 # verify 0.0.0.0

text

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · references/troubleshooting.md (reported line 125)May include surrounding context.

md
- Authentication failed

**Troubleshooting Steps**:
1. Check .env file configuration
2. Verify API_KEY validity
3. Confirm network can access model service
4. Check proxy configuration

Credential diagnostics print secrets without warning about disclosure.

High
Category
Output Handling
Confidence
99% confidence
Finding

The diagnostic commands print cloud access credentials directly, including the secret key. In an agent-assisted deployment workflow, this can expose credentials through tool transcripts, captured terminal output, or troubleshooting logs, potentially allowing cloud operations within the credentials' permissions.

Content

No source excerpt is available for this finding.