Back to skill

Security audit

alibabacloud-oss-deletion-recovery-diagnosis

Security checks for vulnerabilities and agentic risk

Overview

The skill is a mostly read-only Alibaba Cloud OSS diagnostic, but it can automatically expose account bucket inventory when required bucket input is missing.

Install only if you are comfortable granting read-only OSS account metadata access and potential bucket-name disclosure. Prefer running it with an explicit bucket name and a least-privilege RAM role limited to the documented Get/List actions; avoid invoking it from vague prompts where bucket details are missing.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The metadata says the skill should invoke immediately and handle missing details internally, but the body also says bucket name is required and describes ListBuckets fallback enumeration. This mismatch can cause the agent to perform broader account-level discovery than users expect, increasing privacy and scope-creep risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The metadata says the skill should invoke immediately and handle missing details internally, but the body also says bucket name is required and describes ListBuckets fallback enumeration. This mismatch can cause the agent to perform broader account-level discovery than users expect, increasing privacy and scope-creep risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill declares no explicit tool/permission scope even though it is designed to use shell, network, file access, and environment-derived credentials. That creates a broader execution surface than necessary and makes the read-only intent dependent on prompt compliance rather than enforceable platform restrictions.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
81% confidence
Finding

The skill instructs the agent to execute local scripts and shell commands, but without an external enforcement boundary this still grants a path to command execution in the agent runtime. Even though the prose forbids mutating OSS APIs, the actual safety relies on the scripts and environment, so compromise or script drift could turn this into unintended command execution or side effects.

Content

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

md
## Absolute Rules

1. **ABSOLUTE PROHIBITION (read-only enforcement):** Under **NO** circumstances may you generate, write, or execute any command/script calling a mutating OSS API — e.g. `DeleteObject`, `DeleteObjects`, `DeleteBucket`, any version restore (`ossutil revert`), delete-marker removal, multipart abort (`AbortMultipartUpload`), `PutBucketVersioning`, or any ACL/policy/lifecycle change. This includes commands "for the user to run manually" issued from the scripts; recovery and cleanup are described as manual guidance in words only, and the user executes them. If the user asks to restore a version or clean fragments, only output the guidance and declare this skill is read-only. **Empty / not-found is a valid result — never react to it with a write.** If the bucket or object does not exist (`NoSuchBucket` / 404), a query returns empty, or versioning was never configured, that already is a complete conclusion: report it honestly and STOP. Never try to create / re-create / verify / test / validate / restore / repair the bucket or object, and never fall back to hand-written ossutil / SDK / curl calls — stay inside the read-only entry-script flow.
2. **MANDATORY entry-point enforcement:** All OSS diagnostics MUST be performed by running the scripts under `scripts/` (`oss_deletion_recovery_diagnosis.py` as the entry, `sts_token.py` for identity). The Agent is forbidden from assembling its own ossutil / SDK / curl commands against the OSS control plane or bypassing the scripts — the scripts embed timeout, error degradation, and observability guarantees that ad-hoc commands lack. Read the script output, interpret it, and compose the report; do not re-implement the queries.
3. **ABSOLUTE PROHIBITION (credential handling):** Never read, print, or pass AK/SK/STS tokens explicitly. The OSS SDK resolves credentials exclusively from the environment variables of the default credential chain; the identity check uses the aliyun CLI default credential chain. Never accept AK
...[truncated 25 chars]

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
## Absolute Rules

1. **ABSOLUTE PROHIBITION (read-only enforcement):** Under **NO** circumstances may you generate, write, or execute any command/script calling a mutating OSS API — e.g. `DeleteObject`, `DeleteObjects`, `DeleteBucket`, any version restore (`ossutil revert`), delete-marker removal, multipart abort (`AbortMultipartUpload`), `PutBucketVersioning`, or any ACL/policy/lifecycle change. This includes commands "for the user to run manually" issued from the scripts; recovery and cleanup are described as manual guidance in words only, and the user executes them. If the user asks to restore a version or clean fragments, only output the guidance and declare this skill is read-only. **Empty / not-found is a valid result — never react to it with a write.** If the bucket or object does not exist (`NoSuchBucket` / 404), a query returns empty, or versioning was never configured, that already is a complete conclusion: report it honestly and STOP. Never try to create / re-create / verify / test / validate / restore / repair the bucket or object, and never fall back to hand-written ossutil / SDK / curl calls — stay inside the read-only entry-script flow.
2. **MANDATORY entry-point enforcement:** All OSS diagnostics MUST be performed by running the scripts under `scripts/` (`oss_deletion_recovery_diagnosis.py` as the entry, `sts_token.py` for identity). The Agent is forbidden from assembling its own ossutil / SDK / curl commands against the OSS control plane or bypassing the scripts — the scripts embed timeout, error degradation, and observability guarantees that ad-hoc commands lack. Read the script output, interpret it, and compose the report; do not re-implement the queries.
3. **ABSOLUTE PROHIBITION (credential handling):** Never read, print, or pass AK/SK/STS tokens explicitly. The OSS SDK resolves credentials exclusively from the environment variables of the default credential chain; the identity check uses the aliyun CLI default credential chain. Never accept AK
...[truncated 25 chars]

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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 109)May include surrounding context.

md
- **Scope** (`--scope`): optional; `recover` (recoverability assessment), `residue` (residue/attribution), or `all` (default).
- **Expected region** (`--region`): optional; used to derive the query endpoint.
- **Customer wording** (`--question`): optional; the customer's original question wording passed verbatim. Enables the official-doc verification leg (`doc_verification` section) — read-only, help.aliyun.com only, never blocks the diagnosis.
- **UID**: can always be omitted — it is derived via `aliyun sts get-caller-identity` and used only as a traceability label. Auto-fill first, ask second: never ask the user for UID when it can be derived.

**Auto-fill declaration requirement**: Whenever any parameter is auto-filled (query endpoint defaulted or re-derived from the bucket location, UID derived), the Agent MUST explicitly declare this in the response or report metadata, e.g. "query endpoint auto-defaulted to oss-cn-hangzhou.aliyuncs.com (no --region provided)".

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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 232)May include surrounding context.

md
- **Scope** (`--scope`): optional; `recover` (recoverability assessment), `residue` (residue/attribution), or `all` (default).
- **Expected region** (`--region`): optional; used to derive the query endpoint.
- **Customer wording** (`--question`): optional; the customer's original question wording passed verbatim. Enables the official-doc verification leg (`doc_verification` section) — read-only, help.aliyun.com only, never blocks the diagnosis.
- **UID**: can always be omitted — it is derived via `aliyun sts get-caller-identity` and used only as a traceability label. Auto-fill first, ask second: never ask the user for UID when it can be derived.

**Auto-fill declaration requirement**: Whenever any parameter is auto-filled (query endpoint defaulted or re-derived from the bucket location, UID derived), the Agent MUST explicitly declare this in the response or report metadata, e.g. "query endpoint auto-defaulted to oss-cn-hangzhou.aliyuncs.com (no --region provided)".

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

python
"--endpoint", _STS_ENDPOINT,
           "--user-agent", user_agent()]
    try:
        result = subprocess.run(cmd, capture_output=True, text=True,
                                timeout=timeout, stdin=subprocess.DEVNULL)
    except subprocess.TimeoutExpired:
        raise CliError(f"aliyun sts get-caller-identity timed out after "

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

When no bucket is supplied, the script calls ListBuckets and returns up to 30 bucket names visible to the current credential. That expands the skill from diagnosis of a specific deletion event into account inventory disclosure, which can leak sensitive infrastructure metadata to the caller or downstream logs/UI without a clear need for the stated task.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Disclosing bucket names without prior warning or necessity reveals account asset inventory to whoever can trigger the skill without a --bucket parameter. In cloud environments, inventory metadata is often sensitive and can aid reconnaissance, targeting, and correlation of business systems even if no object data is returned.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill exposes account bucket inventory as a user-facing hint even though its declared purpose is read-only recovery diagnosis for a target bucket/object. Bucket names often reveal projects, environments, customers, or internal structure, so this becomes an unnecessary information disclosure primitive.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/_oss_client.py (reported line 288)May include surrounding context.

python
def __getattr__(self, name):
        handle = object.__getattribute__(self, "_handle")
        attr = getattr(handle, name)
        if name.startswith("_") or not callable(attr):
            return attr

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The inline interface documentation states the opposite of the manifest-level intent: it describes bucket input as effectively required and says the script will ask when absent. This is an intent-level contradiction because the skill’s declared behavior is to invoke immediately and handle missing details internally.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.