Back to skill

Security audit

腾讯云对象存储管理

Security checks for vulnerabilities and agentic risk

Overview

This Tencent Cloud COS management skill is coherent, but it needs Review because it recommends account-wide COS permissions and includes destructive operations without strong safeguards.

Install only if you are comfortable managing Tencent COS resources from this skill. Use a dedicated sub-user with bucket- and prefix-scoped least-privilege policies, avoid wildcard COS permissions, do not use `cat` to display `.env` secrets, install dependencies in a virtual environment with pinned versions, and treat delete or force-delete operations as potentially irreversible.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:129
Finding

Account-Wide COS Permissions Violate Least Privilege

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 129-138
Vulnerability Type: Excessive cloud permissions
Risk Level: High

Vulnerable Code

json
{
  "version": "2.0",
  "statement": [
    {
      "effect": "allow",
      "action": [
        "name/cos:*"
      ],
      "resource": "*"
    }
  ]
}

Technical Analysis

The documented access policy grants every Tencent Cloud COS action against every COS resource available to the associated identity. This exceeds the permissions needed for individual workflows such as listing objects, uploading files, or estimating storage costs.

The policy permits sensitive administrative and destructive operations, including bucket configuration changes, ACL changes, object deletion, lifecycle modification, and bucket deletion. The implementation includes destructive functionality such as forced bucket clearing and deletion, so the excessive policy is practically usable rather than merely theoretical.

This also conflicts with the documentation's stated recommendation to apply least privilege. A single broadly authorized credential is exposed to all supported operations without resource-level restrictions, bucket-prefix restrictions, or separation between read-only and administrative roles.

Attack Path

  1. An attacker obtains the configured Tencent Cloud sub-user credentials through host compromise, accidental .env exposure, malicious dependency execution, or another credential disclosure.
  2. The attacker authenticates to Tencent Cloud COS using the unrestricted identity.
  3. The attacker enumerates all accessible buckets because the policy is not scoped to specific resources.
  4. The attacker reads objects, changes bucket ACLs or lifecycle policies, uploads or replaces content, or deletes objects.
  5. The attacker may permanently delete buckets and their contents where the account and COS service permit those actions.

Impact Ass

...[truncated 559 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace name/cos:* with an explicit allowlist of only the APIs required by each workflow.
  • Restrict resource to designated bucket ARNs and, where supported, approved object prefixes.
  • Create separate identities or policies for read-only operations, uploads, lifecycle administration, and destructive operations.
  • Do not grant bucket deletion, ACL modification, or policy-management permissions to routine upload and download roles.
  • Require explicit operator approval and stronger authentication for destructive administrative actions.
  • Apply Tencent Cloud policy conditions such as source network, request context, and resource constraints where available.
  • Rotate any credentials that have already been used with the broad policy and review COS audit logs for unauthorized activity.
  • Add automated policy checks that reject wildcard actions and wildcard resources unless a documented exception is approved.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:163
Finding

Unpinned Dependencies Installed into the System Python Environment

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 163-168
Vulnerability Type: Unsafe dependency installation and supply-chain exposure
Risk Level: Medium

Vulnerable Code

bash
# Install dependencies
pip3 install --break-system-packages \
  cos-python-sdk-v5 \
  python-dotenv

The same unsafe pattern is also documented for the COS SDK at line 119:

bash
pip3 install --break-system-packages cos-python-sdk-v5

Technical Analysis

The installation instructions do not pin exact package versions or verify package hashes. Consequently, the effective code installed by this Skill can change over time without any corresponding change to the reviewed project. Transitive dependencies are likewise unconstrained.

Python package installation can execute package-controlled build or installation logic. If an upstream package, maintainer account, release process, package index, or transitive dependency is compromised, the installation step can introduce and execute attacker-controlled code.

The use of --break-system-packages bypasses protections intended to prevent pip from modifying a distribution-managed Python environment. This expands the impact of dependency conflicts or compromise beyond an isolated project environment and can overwrite or alter packages used by other applications.

No currently malicious dependency was demonstrated during this audit. The vulnerability is the unsafe and non-reproducible installation process.

Attack Path

  1. An attacker compromises an upstream package release, maintainer account, package index path, or transitive dependency.
  2. A user follows the documented installation command at a later time.
  3. pip resolves the unpinned package or dependency to the compromised release.
  4. Package build or installation logic executes under the privileges of the user running pip.
  5. Because the command targets the system-managed Python environment, ma ...[truncated 772 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove --break-system-packages and install dependencies in a dedicated virtual environment or container.
  • Pin every direct dependency to an exact, reviewed version.
  • Lock transitive dependencies using a reproducible dependency lock file.
  • Record and verify package hashes, for example through a requirements file used with pip install --require-hashes.
  • Use a trusted, explicitly configured package index and secure repository transport.
  • Run dependency vulnerability and provenance checks in continuous integration.
  • Review dependency updates before changing pinned versions rather than automatically accepting the newest release.
  • Perform installation under a non-privileged account and avoid exposing cloud credentials during package installation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

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

md
- ✅ 使用子用户密钥,不用主账号
- ✅ 设置最小权限
- ✅ .env 文件妥善保管
- ✅ 定期轮换密钥 (90 天)
- ❌ 不要提交密钥到 Git

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

python
- ✅ 使用子用户密钥,不用主账号
- ✅ 设置最小权限
- ✅ .env 文件妥善保管
- ✅ 定期轮换密钥 (90 天)
- ❌ 不要提交密钥到 Git

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The troubleshooting step instructs users to run cat config/.env, which can print cloud API credentials directly to the terminal, logs, scrollback, recordings, or shared support sessions. Even though intended for debugging, this normalizes exposing secrets and increases the risk of accidental credential disclosure.

Content

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

问题 1: 凭证验证失败

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

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/cos_manager.py (reported line 590)May include surrounding context.

python
rules.append(rule_dict)
            
            return rules
        
        except CosServiceError as e:
            print(f"❌ 获取失败:{e}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill explicitly advertises bucket deletion as a core capability but does not pair it with a clear warning that deletion can cause permanent data loss, service disruption, or accidental destruction of backups. In infrastructure-management skills, omission of destructive-operation safeguards materially increases the chance of operator error, even if there is no malicious behavior.

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

上传文件

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

python
### 上传文件

```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/cos_manager.py (reported line 439)May include surrounding context.

python
### 上传文件

```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/cos_manager.py (reported line 730)May include surrounding context.

python
### 上传文件

```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
96% confidence
Finding

The code exposes destructive operations for bucket and object deletion, including a force-delete path that recursively removes all objects, without any confirmation prompt, dry-run mode, safeguard flag, or explicit warning at the call site. In an agent or automation context, this materially increases the risk of accidental or prompt-induced irreversible data loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The documentation promotes upload, download, and batch upload workflows without clearly warning that data transferred to cloud object storage may contain sensitive, regulated, or customer information. This omission can lead users to move data off-host or across regions without considering privacy, retention, residency, or sharing implications.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

User-facing strings, help text, and operational messages throughout the file are written exclusively in Chinese, which forces a specific language experience. There is no indication that the tool is intentionally region- or language-specific, nor any opt-in or fallback for other locales.

Content

No source excerpt is available for this finding.