Back to skill

Security audit

huawei-cloud-optv-solver-assistant

Security checks for vulnerabilities and agentic risk

Overview

This cloud optimization assistant needs review because insecure connections, unsafe downloads, and unreliable approval checks put credentials and local files at risk.

Wait for fixes to certificate verification, download-path confinement, approval checks, and token storage before supplying real credentials. Selected documents and spreadsheets are sent to Huawei Cloud. Use approved data and narrowly scoped cloud permissions, review the CLI privacy agreement yourself, and explicitly choose whether to deploy a running cloud service.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
.
Finding

TLS verification is disabled for authenticated cloud requests

Content
View full analysis

Impact

An interceptor can capture the IAM bearer token and submitted chat content, impersonate the user within the token's permissions, and replace downloaded artifacts or SSE metadata.

T09 · Insecure Skill Coding Practices

Error
Location
.
Finding

Remote artifact filenames can escape the artifacts directory

Content
View full analysis

Impact

A filename such as ../scripts/create_chat.py resolves to the existing scripts directory and overwrites the authentication helper with attacker-supplied bytes, enabling code execution when that helper is next run or imported. Other writable files can also be overwritten. OBS names containing percent-encoded separators likewise escape confinement after unquote.

T09 · Insecure Skill Coding Practices

Warning
Location
.
Finding

Confirmation gates fail open when stdin reaches EOF

Content
View full analysis

Impact

Unreviewed generated artifacts can be published using the user's cloud credentials despite the documented requirement for explicit stage confirmation and despite omission of --auto-confirm.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (64)

Tainted flow: 'url' from os.environ.get (line 177, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/run_workflow.py (reported line 195)May include surrounding context.

python
"X-Auth-Token": token,
        "X-Chat-Route-Id": route_id,
    }
    resp = requests.post(
        url,
        data=json.dumps(body, ensure_ascii=False).encode("utf-8"),
        headers=headers, stream=True, verify=False, timeout=300,

Tainted flow: 'url' from os.environ.get (line 249, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/run_workflow.py (reported line 255)May include surrounding context.

python
"X-Chat-Route-Id": route_id,
        "X-Need-Content": "true",
    }
    resp = requests.get(
        url, headers=headers, verify=False, timeout=60,
        proxies={"http": None, "https": None},
    )

Tainted flow: 'model_request' from requests.get (line 778, network input) → subprocess.run (code execution)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

External input (network, user) flows to a code execution sink. This enables remote code execution or command injection.

Content

Scanner excerpt · scripts/run_workflow.py (reported line 435)May include surrounding context.

python
Returns: {"task_id": str, "status": str} or None.
    """
    result = subprocess.run(
        [HCLOUD, "OptVerse", "CreateModelServiceTask",
         f"--cli-region={REGION}",
         f"--service_id={service_id}",

Tainted flow: 'task_id' from requests.get (line 793, network input) → subprocess.run (code execution)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

External input (network, user) flows to a code execution sink. This enables remote code execution or command injection.

Content

Scanner excerpt · scripts/run_workflow.py (reported line 475)May include surrounding context.

python
"""ShowModelServiceTask via hcloud — get task details and outputs.
    Returns the full response dict (contains status and outputs).
    """
    result = subprocess.run(
        [HCLOUD, "OptVerse", "ShowModelServiceTask",
         f"--cli-region={REGION}",
         f"--service_id={service_id}",

Tainted flow: 'dl_url' from os.environ.get (line 765, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/run_workflow.py (reported line 766)May include surrounding context.

python
from urllib.parse import quote
                encoded = quote(json_fname, safe="")
                dl_url = f"https://{endpoint}/v1/{PROJECT_ID}/chats/{chat_id}/file/{encoded}/download"
                dl_resp = requests.get(
                    dl_url,
                    headers={"X-Auth-Token": token, "X-Chat-Route-Id": route_id,
                              "X-Need-Content": "true"},

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied command accesses cloud CLI configuration rather than performing an identified OptVerse modeling or solving operation. No connection to the declared optimization workflow is established in this chunk, making this an undeclared resource-access capability. The command alone does not establish credential exfiltration or configuration modification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied chunk only queries the hcloud CLI version and shows no connection to OptVerse or mathematical optimization. No evidence establishes this as a supporting dependency check for the declared workflow. The command does not itself provision cloud resources or modify data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The core workflow matches the description. However, --deploy creates a running cloud model service, and --test automatically enables deployment and submits a service task. These are distinct cloud resource provisioning and execution capabilities not disclosed by the description, which ends at asset publication. They are opt-in rather than default behavior, but remain implemented capabilities. Authentication, file transfers, and local artifact handling are supporting implementation details and are not independently treated as mismatches.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

该代码的实际操作是检查 hcloud 配置,而非执行所声明的数学规划或优化求解任务。所提供内容没有说明 hcloud 是 OptVerse 的依赖,也未建立该配置查询与声明流程之间的联系,因此属于未声明的资源访问。仅凭此命令不能断定存在凭据泄露、配置修改或数据外传。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

检查 CLI 版本可以属于安装流程的辅助实现细节,本身不构成不匹配。但该命令还明确尝试自动接受隐私协议,这涉及替用户作出隐私同意决定,超出了所声明的优化建模与求解能力。此片段并不能证明实际发生了数据上传或其他云资源操作。

Content

No source excerpt is available for this finding.

The troubleshooting instructions recommend disabling TLS certificate verification without warning about the security consequences.

High
Category
Output Handling
Confidence
99% confidence
Finding

The troubleshooting guidance recommends disabling TLS certificate verification, removing server authentication for affected CLI requests. An attacker able to intercept traffic could impersonate cloud endpoints and capture sensitive request data or alter responses; the workflow's authentication and business-data handling make this particularly dangerous.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

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

text

**Security flow**:
1. If the credentials file does not exist, the agent creates the empty template directly (keys only, empty values) — do NOT write real credential values; the user fills them in manually. No need to run any script to generate the template
2. Every run, the script (`scripts/create_chat.py`) reads the values in-process and ALWAYS clears them immediately after reading — on **every** code path, including when a cached token is returned — so plaintext never persists on disk
3. Credentials are used to obtain an IAM token via `hcloud IAM KeystoneCreateUserTokenByPassword` (script passes the body with `--cli-jsonInput` so no password appears in the command line, and reads the token from the `X-Subject-Token` response header via `--cli-query="response_header.X-Subject-Token$1."` — never displayed)
4. Token is cached in-memory (and a temp file for cross-process reuse, 23h)

The workflow uploads requirement files and business data to Huawei Cloud without a user-facing privacy warning.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The skill instructs the agent to upload requirement documents and model data to the external OptVerse service, rather than merely listing upload capabilities. Although the architecture describes these transfers, the skill does not warn users that potentially sensitive business information leaves their local environment or instruct the agent to disclose this before the initial upload.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

--test

text

Use `--auto-confirm` to skip user confirmation prompts.
Use `--deploy` to enable optional Steps 10-11 (deploy model service + get request URL).
Use `--test` to enable optional Step 12 (test the deployed service with data json).

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

--test

text

Use `--auto-confirm` to skip user confirmation prompts.
Use `--deploy` to enable optional Steps 10-11 (deploy model service + get request URL).
Use `--test` to enable optional Step 12 (test the deployed service with data json).

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · references/acceptance-criteria.md (reported line 95)May include surrounding context.

md
| AK/SK exposure | Never in stdout, logs, or reports | AK/SK visible in any output |
| AK/SK in conversation | Never asked user to type AK/SK in chat | User prompted for plaintext credentials |
| Sensitive value in reasoning | Token/credentials never appear in agent output, tool output, or chain-of-thought | Any sensitive value echoed or read via tools |
| File permissions | Script not world-readable | Script readable by all users |
| Debug output | AK masked as `XXXX****XXX` | Full AK/SK in debug output |

## 5. Workflow Validation

The workflow requires uploading user files and data to OptVerse without a privacy warning.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The workflow validation explicitly requires successful file uploads, including uploading data and starting a data check in Step 7. Although credential handling is covered elsewhere in this file, there is no disclosure that user file contents will be transmitted to an external cloud service or warning about uploading sensitive data.

Content

No source excerpt is available for this finding.

The test-call workflow transmits user-derived model data to a cloud service without a privacy disclosure.

Medium
Category
Output Handling
Confidence
91% confidence
Finding

The workflow instructs the agent to download the data-stage JSON and submit its contents to OptVerse through CreateModelServiceTask. It does not warn that this sends potentially sensitive user data to an external cloud service; the general instruction to confirm between stages does not disclose this privacy impact.

Content

No source excerpt is available for this finding.

The workflow uploads requirement files and sends requirement text to OptVerse without a privacy warning.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

These verification steps instruct the agent to upload a local requirement file and submit requirement text to an external cloud service. The document does not warn that potentially sensitive user content will leave the local environment or instruct the agent to obtain authorization before transmitting it.

Content

No source excerpt is available for this finding.

The workflow uploads user requirements and spreadsheets to OptVerse without a privacy warning.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

These are steps in the skill's own workflow, not merely a catalog of available tools. They direct the transfer of user files and requirement content to an external service without warning users about that transfer or the potential exposure of sensitive data.

Content

No source excerpt is available for this finding.

The confirmation pattern requires a Chinese-language user response without offering a language choice.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The instruction requires an explicit user response of "确认" for every round, imposing a Chinese confirmation phrase regardless of the user's language. No language opt-in or justification for this user-facing restriction is provided; fixed backend message strings alone would not create this issue.

Content

No source excerpt is available for this finding.

Tainted flow: 'TOKEN_FILE' from os.environ.get (line 85, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
99% confidence
Finding

The script stores a reusable IAM bearer token in plaintext at a predictable temporary path without enforcing restrictive permissions or checking ownership and symlinks. On shared systems, filesystem permissions may expose the token, while a precreated symlink can redirect the write; the 23-hour reuse window increases the consequences of token theft.

Content

Scanner excerpt · scripts/create_chat.py (reported line 156)May include surrounding context.

python
def _save_token(token, region):
    """Persist the IAM token to the temp-file cache (temp dir only)."""
    try:
        with open(TOKEN_FILE, "w", encoding="utf-8") as f:
            f.write(f"{time.time()}\n{region}\n{token}\n")
    except (OSError, IOError):
        print(f"[WARN] Failed to save token cache", file=sys.stderr)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/create_chat.py (reported line 271)May include surrounding context.

python
"--cli-output=tsv",
            "--cli-query=response_header.X-Subject-Token",
        ]
        result = subprocess.run(
            cmd,
            capture_output=True,
            text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/create_chat.py (reported line 380)May include surrounding context.

python
def get_project_id(hcloud_path, region):
    """Get project_id from hcloud dryrun output."""
    try:
        result = subprocess.run(
            [
                hcloud_path,
                "OptVerse",