Back to skill

Security audit

txcloud-diagnostics

Security checks for vulnerabilities and agentic risk

Overview

The skill is a plausible Tencent Cloud diagnostics helper, but it includes cloud login handling and remote shell execution without strong technical limits or clear per-action user approval.

Review before installing. Use only with least-privilege Tencent Cloud credentials, and do not allow it to run TAT commands unless you explicitly approve each command and understand it will execute on your cloud instance. Treat the auth code and /tmp log files as sensitive, and clean up any daemon or temporary auth files after use.

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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/prefetch.py:142
Finding

Unrestricted Remote Shell Execution Through Tencent Cloud TAT

Content
View full analysis
Dict: """通过 TAT 远程执行 Shell 命令,自动 base64 编码、执行、等待、解码输出""" import base64 import time b64_content = base64.b64encode(command.encode("utf-8")).decode("utf-8") data = run_tccli([ "tat", "RunCommand", "--region", region, "--InstanceIds", json.dumps([instance_id]), "--CommandType", "SHELL", "--Content", b64_content, "--Timeout", str(timeout), ]) ``` ```python parser.add_argument("--exec-tat", default=None, help="通过 TAT 远程执行只读 Shell 命令(CVM/Lighthouse 专用)。" "示例: --exec-tat 'top -bn1 | head -20'") parser.add_argument("--tat-timeout", type=int, default=60, help="TAT 命令超时秒数(默认 60)") args = parser.parse_args() # ── TAT 远程执行模式 ── if args.exec_tat: tat_result = exec_tat_command(args.region, args.instance_id, args.exec_tat, args.tat_timeout) print(json.dumps(tat_result, ensure_ascii=False, indent=2)) sys.exit(0 if tat_result.get("status") == "ok" else 1) ``` ### Technical Analysis The `--exec-tat` argument is accepted as an unrestricted string and sent to Tencent Cloud TAT with `CommandType` set to `SHELL`. Base64 encoding only satisfies the TAT transport format and provides no validation or security boundary. The product profile states that only read-only commands should be used, but this restriction exists only as natural-language guidance. The implementation does not enforce an executable allowlist, argument validation, shell-metacharacter filtering, product restrictions, or explicit user confirmation. Consequently, the input can contain destructive commands, redirection, command substitution, pipelines, cr ...[truncated 1424 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:94
Finding

Shell Injection Through Authorization-Code Command Construction

Content
View full analysis
/tmp/tccli_daemon.log 2>&1 & sleep 5 && cat /tmp/tccli_daemon.log && cat /tmp/tccli_auth_link.txt ``` The instructions then require the user-supplied authorization value to be written using: ```bash echo '<用户回复的验证码>' > /tmp/tccli_auth_input_code.txt sleep 5 && cat /tmp/tccli_daemon.log ``` ### Technical Analysis The Skill instructs the agent to insert a user-supplied authorization string directly inside a single-quoted shell command. There is no escaping, validation, or non-shell transfer mechanism. Although a legitimate authorization value is expected to resemble Base64 data, the implementation does not enforce that format. A value containing a single quote can terminate the quoted argument and append arbitrary shell syntax. This turns conversational input into executable local shell content. Encoding expectations are not an adequate defense because they are documented only as instructions and are not validated before command construction. ### Attack Path 1. The authorization workflow asks the user to return a verification value. 2. An attacker supplies a value containing a single quote followed by shell commands. 3. The agent substitutes that value into the documented `echo '...'` command. 4. The injected quote terminates the intended string. 5. The shell interprets the remaining attacker-controlled text as commands. 6. The commands execute locally with the privileges of the agent process. ### Impact Assessment Exploitation can provide local command execution within the Skill runtime environment. Depending on runtime permissions, an attacker could read accessible files, modify project or configuration data, invoke installed tools, access local cloud credent ...[truncated 229 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tccli_auth_daemon.py:21
Finding

Authorization Material Stored in Predictable and Insecure Temporary Files

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The skill includes an authentication bootstrap flow that starts a background daemon, generates authorization links, stores artifacts in /tmp, and processes user-supplied auth codes, none of which is apparent from the headline description. Hidden authentication handling is sensitive because it involves credentials and session establishment, expanding both attack surface and data-handling obligations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill includes an authentication bootstrap flow that starts a background daemon, generates authorization links, stores artifacts in /tmp, and processes user-supplied auth codes, none of which is apparent from the headline description. Hidden authentication handling is sensitive because it involves credentials and session establishment, expanding both attack surface and data-handling obligations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill includes an authentication bootstrap flow that starts a background daemon, generates authorization links, stores artifacts in /tmp, and processes user-supplied auth codes, none of which is apparent from the headline description. Hidden authentication handling is sensitive because it involves credentials and session establishment, expanding both attack surface and data-handling obligations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script claims TAT will run only read-only shell commands, but exec_tat_command accepts and executes any caller-supplied command on the target instance via Tencent Cloud TAT. In an agent skill context, this creates a dangerous gap between stated purpose and actual capability, enabling arbitrary remote command execution on customer infrastructure if the option is exposed or misused.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This skill is described as a diagnostics helper that checks credentials, queries instance data, and fetches metrics, but the code additionally implements a full remote execution path through TAT RunCommand. That expands the trust boundary from observability into active code execution on cloud instances, which is substantially more dangerous in an AI-driven workflow because model-generated or user-influenced input could be turned into actions on live systems.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The main entrypoint exposes --exec-tat as an alternate mode in a script whose normal purpose is diagnostic data prefetch. In the context of a cloud troubleshooting skill, embedding unnecessary shell execution increases the chance of accidental misuse, prompt-influenced abuse, or privilege escalation through existing cloud credentials, making the skill materially more dangerous than its stated function suggests.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill is described as a Tencent Cloud diagnostics tool, but this code implements an interactive tccli login flow that acquires and validates user credentials. That is a scope mismatch: it enables account access establishment rather than incident analysis, increasing the chance of unnecessary privilege acquisition and abuse if the skill is triggered in normal support contexts.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes shell commands, reads local files, and writes to /tmp, but declares no explicit tool scope or permission boundaries. That increases the chance of overbroad execution in hosts that infer capability from content, and makes it harder for operators to constrain file-system and shell access to the minimum necessary.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation description is broad enough to trigger on many generic Tencent Cloud complaints, which can cause the skill to run in contexts the user did not clearly intend. Overbroad triggering is risky here because the skill can invoke shell, local file operations, and cloud authentication flows.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The instructions impose Beijing time as the default and require a fixed Chinese output style for user-visible responses, but do not offer the user a language or locale choice. This is a natural-language policy issue because it forces locale/language behavior without opt-in or a clearly documented regional justification.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

Starting a background process with nohup creates session persistence beyond the immediate interaction, which increases the risk of orphaned credential-handling processes, stale auth state, and unintended reuse across requests. Persistent daemons are especially sensitive in a skill that handles login links, auth codes, and writes to shared temporary paths.

Content

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

当 prefetch.py 返回 auth_failed 时执行:

bash
nohup python3 -u scripts/tccli_auth_daemon.py > /tmp/tccli_daemon.log 2>&1 &
sleep 5 && cat /tmp/tccli_daemon.log && cat /tmp/tccli_auth_link.txt

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs writing a user-provided authentication code directly to a temporary file without warning, minimization, or secure lifecycle controls. Sensitive auth material in /tmp may be readable by other local processes or remain after use, creating a risk of credential theft or unintended reuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language descriptions and report strings indicate the tool is intended to operate and present results in Chinese only, with no opt-in or alternative locale documented. This is a language/locale policy concern because the skill imposes a specific language rather than offering user choice or stating a justified region-specific requirement.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module documentation states that the script performs no mapping, inference, or retries, yet the implementation auto-discovers related CBS disks and diagnoses them. In an AI-agent workflow, this mismatch is security-relevant because orchestration layers and reviewers may trust the documented scope when deciding whether to grant credentials or run the skill, causing underestimation of what data the script can access.

Content

No source excerpt is available for this finding.

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/diagnose.py (reported line 112)May include surrounding context.

python
"""检查 tccli 是否已安装且凭证有效"""
        # 1. 检查 tccli 是否安装
        try:
            result = subprocess.run(
                ["which", "tccli"],
                capture_output=True, text=True, timeout=5
            )

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/diagnose.py (reported line 127)May include surrounding context.

python
# 2. 检查凭证是否有效
        try:
            result = subprocess.run(
                ["tccli", "cvm", "DescribeRegions", "--output", "json"],
                capture_output=True, text=True, timeout=15
            )

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script expands its behavior beyond the user-specified instance/metric query by automatically discovering attached CBS disks and collecting additional telemetry. In an agent setting, this violates least surprise and least privilege: a user asking to diagnose one resource can trigger enumeration of related assets and access metadata/monitoring data they did not explicitly request, increasing data exposure and operational scope.

Content

No source excerpt is available for this finding.

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/diagnose.py (reported line 82)May include surrounding context.

python
"""执行 tccli 命令并返回 JSON 解析结果"""
    cmd = ["tccli"] + args + ["--output", "json"]
    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
        output = (result.stdout + result.stderr).strip()

        auth_keywords = ["AuthFailure", "TokenFailure", "RefreshTokenError", "credential"]

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/prefetch.py (reported line 63)May include surrounding context.

python
"""执行 tccli 命令并返回 JSON 解析结果"""
    cmd = ["tccli"] + args + ["--output", "json"]
    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
        output = (result.stdout + result.stderr).strip()

        auth_keywords = ["AuthFailure", "TokenFailure", "RefreshTokenError", "credential"]

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The note states that monitoring data for multiple products should uniformly use the ap-guangzhou region. This is a natural-language locale/region constraint, and the file does not offer user opt-in or explain why this region is required for all cases.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document instructs the agent to perform remote OS command execution via TAT, which materially expands the skill from passive monitoring analysis into active access of customer instances. Even if the commands are intended to be read-only, this enables collection of sensitive host-level data and creates a command-execution pathway whose safety depends on strict parameter handling, consent, and enforcement outside the document.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill says the model should proactively trigger OS diagnostics without waiting for user instruction, which means commands may run on an instance and expose system details without clear informed consent. In a cloud environment, even read-only diagnostics can reveal secrets, internal topology, service names, logs, and tenant-sensitive operational data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all user-facing instructions and labels only in Chinese, which can constitute a language/locale policy violation when no user opt-in or explicit region-specific justification is provided. The file does not indicate that the skill is limited to Chinese-speaking users or offer an alternative language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document explicitly permits remote command execution through TAT for deeper diagnosis but does not require an explicit user confirmation, scope limitation, or warning about operational impact on the target instance. In a cloud diagnostics skill, this increases the risk of unintended command execution against production workloads, which could alter system state, consume resources, or disrupt services if the workflow proceeds too aggressively.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Line L30 states that COS/CI monitoring data must uniformly use ap-guangzhou, which is a locale/region restriction expressed in natural language. The file does not indicate that this is optional, user-selected, or required for a documented compliance or product limitation, so it appears to force a specific locale without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.