Back to skill

Security audit

TencentCloud OPS

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Tencent Cloud operations helper, but it asks for very broad cloud permissions and exposes destructive actions without enough safeguards.

Review this skill before installing. Use a dedicated non-production Tencent Cloud sub-user, replace the wildcard policies with narrow actions and resource scopes, avoid printing or sharing .env contents, do not run destructive methods without separately verifying the target resource, and install dependencies in a virtual environment with pinned versions.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:96
Finding

Account-Wide Wildcard Permissions Exceed the Skill's Operational Requirements

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:96-125
Vulnerability Type: Excessive cloud IAM permissions
Risk Level: High

Vulnerable Code

bash
cat > /tmp/cvm-policy.json << 'EOF'
{
  "version": "2.0",
  "statement": [
    {
      "effect": "allow",
      "action": ["cvm:*", "vpc:*", "cbs:*"],
      "resource": "*"
    }
  ]
}
EOF

tccli cam CreatePolicy \
  --PolicyName "CVM-Manager" \
  --PolicyDocument "$(cat /tmp/cvm-policy.json)" \
  --Description "CVM server management permissions"
bash
cat > /tmp/cos-policy.json << 'EOF'
{
  "version": "2.0",
  "statement": [
    {
      "effect": "allow",
      "action": ["name/cos:*"],
      "resource": "*"
    }
  ]
}
EOF

Technical Analysis

The installation instructions grant every CVM, VPC, CBS, and COS action against every resource available to the Tencent Cloud account. These permissions are substantially broader than the operations implemented in src/tencent_ops.py, which primarily list, create, start, stop, and terminate CVM instances; inspect or create security groups; and perform selected bucket and object operations.

Wildcard actions also authorize sensitive operations that are not required by the implementation. Using "resource": "*" removes resource-level isolation between resources managed by this Skill and unrelated production resources in the same account.

This violates least privilege. Although the instructions recommend creating a sub-user, that sub-user remains highly privileged across multiple Tencent Cloud services.

Attack Path

  1. An operator follows SKILL.md and creates the wildcard policies.
  2. The policies are attached to the Skill's Tencent Cloud sub-user.
  3. The corresponding Secret ID and Secret Key are stored in the local environment or .env file.
  4. An attacker obtains those credentials through host compromise, accidental disclosure, malicious dep ...[truncated 1051 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace service-wide wildcard actions with an explicit allowlist of API actions actually used by the implementation.
  • Separate read-only, resource-creation, and destructive operations into distinct policies or roles.
  • Restrict permissions by project, region, resource identifier, bucket ARN, resource prefix, and tags wherever Tencent Cloud IAM supports those conditions.
  • Require an independently authorized role for destructive operations such as instance termination and bucket deletion.
  • Avoid granting CBS permissions unless disk-management functionality is actually implemented.
  • Limit VPC permissions to security-group describe and create operations if those are the only required functions.
  • Limit COS permissions to the specific buckets and object prefixes managed by the Skill.
  • Rotate credentials regularly and use short-lived credentials where possible.
  • Document the exact required IAM actions and validate the policy using a dedicated non-production account before deployment.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:198
Finding

Unpinned Dependencies Are Installed into the System Python Environment

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:198-202
Vulnerability Type: Unsafe dependency installation and supply-chain exposure
Risk Level: Medium

Vulnerable Code

bash
pip3 install --break-system-packages \
  tencentcloud-sdk-python \
  cos-python-sdk-v5 \
  python-dotenv

Technical Analysis

The installation command does not pin package versions or verify package hashes. It also uses --break-system-packages, which bypasses protections intended to prevent pip from modifying a Python environment managed by the operating system.

Consequently, installation behavior can change over time as new package versions and transitive dependencies are published. A compromised upstream release, dependency account, package index, or transitive package could introduce attacker-controlled installation or runtime code. Modifying the system Python environment also risks dependency conflicts and can affect unrelated applications using that interpreter.

No malicious dependency is present in the reviewed project, and the named packages correspond to the declared functionality. The risk arises from the unsafe and non-reproducible installation process.

Attack Path

  1. An operator runs the documented pip3 install --break-system-packages command.
  2. pip resolves the newest available versions and their transitive dependencies at installation time.
  3. An upstream package, release account, dependency, or configured package index is compromised.
  4. The compromised package executes installation or import-time code with the privileges of the operator.
  5. Because installation targets the system Python environment, the malicious or incompatible package may also affect other local Python applications.

Impact Assessment

Successful supply-chain exploitation would execute code with the privileges of the user running pip. If the command is run with elevated privileges, system-wide compromise may res ...[truncated 401 chars]

Remediation
View remediation

Remediation Suggestions

  • Create and use a dedicated virtual environment rather than modifying the system Python environment.
  • Remove --break-system-packages from the documented installation command.
  • Pin direct and transitive dependencies to reviewed versions in a lock file.
  • Record and verify cryptographic hashes, such as by using pip install --require-hashes.
  • Install packages only from a trusted, explicitly configured package index.
  • Periodically scan locked dependencies for known vulnerabilities.
  • Test dependency upgrades separately before updating the lock file.
  • Run the Skill as a non-privileged operating-system user.

T09 · Insecure Skill Coding Practices

Warning
Location
src/tencent_ops.py:244
Finding

Unvalidated Instance Identifier Is Embedded in an Executable Cron Command

Content
View full analysis

Vulnerability Details

File Location: src/tencent_ops.py:244-260
Vulnerability Type: Generated command injection
Risk Level: Medium

Vulnerable Code

python
def schedule_shutdown(self, instance_id: str, days: int = 30):
    """Scheduled shutdown"""
    shutdown_time = datetime.now() + timedelta(days=days)

    print(f"Scheduled shutdown configured")
    print(f"   Instance: {instance_id}")
    print(f"   Time: {shutdown_time.strftime('%Y-%m-%d %H:%M')}")
    print(f"   Days: after {days} days")

    # The actual implementation requires a scheduled task or cloud function.
    # This only provides instructions.
    print(f"\nTip: use crontab or a cloud function for scheduled shutdown")
    print(f"""
# crontab example
{shutdown_time.minute} {shutdown_time.hour} {shutdown_time.day} {shutdown_time.month} * \
  python3 -c "from tencent_ops import CVMManager; CVMManager().stop_instance('{instance_id}')"
        """)

The displayed English text above translates the original user-facing messages; the executable interpolation and control flow are unchanged.

Technical Analysis

instance_id is interpolated directly into Python source code embedded in a shell command. The value is not validated against Tencent Cloud's expected instance-ID syntax and is not safely encoded as a Python string or shell argument.

The method does not itself modify crontab or register a service. Therefore, the static persistence indicator is not a confirmed T06: System Persistence issue. Scheduled shutdown is also consistent with the Skill's declared cost-control functionality. However, the generated command is unsafe if an operator follows the instructions and installs it in crontab.

A crafted value can terminate the stop_instance() argument, append arbitrary Python statements, and comment out the remaining syntax. For example, an attacker-controlled value following this pattern could inject a command:

...[truncated 1580 chars]

Remediation
View remediation

Remediation Suggestions

  • Validate instance_id against the strict Tencent Cloud CVM instance-ID format before using it.
  • Do not generate executable python -c source containing user-controlled values.
  • Implement a fixed command-line entry point that accepts the instance ID as a separate argument.
  • If a shell command must be displayed, encode each argument with shlex.quote; do not rely on manual quoting.
  • Parse and validate the identifier again inside the command-line entry point.
  • Prefer a Tencent Cloud-native scheduler or cloud function with a narrowly scoped service role.
  • Clearly state that the method only generates instructions and has not actually scheduled a shutdown.
  • If local scheduling is implemented later, require explicit confirmation, use a dedicated unprivileged account, avoid inheriting unnecessary environment variables, and provide a safe removal procedure.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (19)

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

bash
cd skills/tencentcloud-ops
cp config/.env.example config/.env
vim 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 · SKILL.md (reported line 157)May include surrounding context.

bash
cd skills/tencentcloud-ops
cp config/.env.example config/.env
vim 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 · SKILL.md (reported line 232)May include surrounding context.

bash
cd skills/tencentcloud-ops
cp config/.env.example config/.env
vim 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 · SKILL.md (reported line 237)May include surrounding context.

bash
cd skills/tencentcloud-ops
cp config/.env.example config/.env
vim 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 · SKILL.md (reported line 345)May include surrounding context.

bash
cd skills/tencentcloud-ops
cp config/.env.example config/.env
vim 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 · src/tencent_ops.py (reported line 415)May include surrounding context.

python
```bash
cd skills/tencentcloud-ops
cp config/.env.example config/.env
vim config/.env
```

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The troubleshooting step tells users to run 'cat config/.env', which prints secrets directly to the terminal and risks exposure through terminal logs, screen sharing, shell recording, support transcripts, or copied output. In a support/debugging workflow, this normalizes unsafe secret disclosure and can easily leak active cloud credentials.

Content

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

问题 1: 凭证验证失败

bash
cat config/.env
python3 src/verify_config.py

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code performs irreversible instance termination immediately on a single method call, with no confirmation prompt, dry-run, resource-name verification, or safety interlock. In an agent or automation context, this increases the risk of accidental or unauthorized destructive actions that can cause outage and data loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Bucket deletion is executed without confirmation or safeguards, which is dangerous because storage buckets may contain critical or sensitive data and deletion may be irreversible or operationally disruptive. In automation scenarios, a mistaken parameter or prompt-influenced action could destroy production data quickly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The title and throughout the document present the skill instructions entirely in Chinese, with no indication that users may choose another language or locale. Under the policy criteria, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The markdown advertises creating and deleting CVM servers and COS buckets, but it does not explicitly warn near these capabilities that deletion may permanently remove infrastructure or stored data. For markdown files, safety warnings should clearly disclose behaviors that can affect user data or system integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The cost-control section states that the skill can automatically release idle resources, which can terminate running services or remove infrastructure unexpectedly if misconfigured. The markdown does not provide a direct warning about operational impact, confirmation expectations, or the need to verify selection criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document claims CAM user management is not granted as part of the skill, yet the setup explicitly instructs users to create CAM users, policies, attach policies, and generate access keys. This mismatch can mislead operators about the real privilege boundary and normalization of IAM manipulation, increasing the chance of over-privileged accounts and unsafe trust in the skill's scope.

Content

No source excerpt is available for this finding.

Cloud Storage Exfiltration

Medium
Category
Data Exfiltration
Confidence
55% confidence
Finding

Data is uploaded to cloud storage (S3 / GCS / Azure Blob). This may be a legitimate backup or exfiltration to an external bucket. Manual review is recommended.

Content

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

上传文件到 COS

python
cos.upload_file(
    bucket="my-data-bucket",
    local_path="/tmp/data.parquet",
    key="data/2024/03/28/data.parquet"

Cloud Storage Exfiltration

Medium
Category
Data Exfiltration
Confidence
55% confidence
Finding

Data is uploaded to cloud storage (S3 / GCS / Azure Blob). This may be a legitimate backup or exfiltration to an external bucket. Manual review is recommended.

Content

Scanner excerpt · src/tencent_ops.py (reported line 365)May include surrounding context.

python
### 上传文件到 COS

```python
cos.upload_file(
    bucket="my-data-bucket",
    local_path="/tmp/data.parquet",
    key="data/2024/03/28/data.parquet"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The code reads Tencent Cloud secret credentials directly from environment variables, which is a sensitive operation under the warning criteria for code files. While configuration validation prints whether the variables are present, the file does not provide a user-facing warning, confirmation, or explanatory comment about securely handling cloud credentials or the sensitivity of these values.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The upload_file method reads a local file and sends its contents to COS, which is a network transmission of user/system data. Although it prints success afterward, there is no prior warning, confirmation, or clear documentation alerting the user that local data will be uploaded to a remote cloud service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring and all user-facing CLI/help strings are written only in Chinese, with no indication that users can choose another language. Under the language/locale policy criteria, this is a natural-language policy issue because the skill imposes a specific language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code sets StoppedMode to KEEP_CHARGING, which indicates the instance remains allocated and billing may continue, but the inline comment says 停机不收费 ('stopped and not charged'). This is an active contradiction between documentation and behavior, not merely an omission.

Content

No source excerpt is available for this finding.