Back to skill

Security audit

Huawei Cloud OBS SDK

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Huawei OBS SDK guide, but some examples can expose or overwrite data without enough guardrails.

Review before installing or copying examples into production. Use least-privilege OBS credentials, pin dependency versions, add confirmations for delete/lifecycle/public-access changes, and do not use the folder download sample against untrusted buckets until it validates normalized paths stay inside the chosen download directory.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
references/advanced_features.md:115
Finding
OBS Object Keys Can Escape the Intended Download Directory<![CDATA[ ## Vulnerability Details **File Location**: `references/advanced_features.md:115-125` **Vulnerability Type**: Path traversal leading to arbitrary local file overwrite **Risk Level**: High ### Vulnerable Code ```python object_key = obj['key'] # Calculate the local file path relative_path = object_key[len(obs_prefix):] if object_key.startswith(obs_prefix) else object_key relative_path = relative_path.lstrip('/') local_file_path = os.path.join(local_folder_path, relative_path) # Ensure that the local directory exists os.makedirs(os.path.dirname(local_file_path), exist_ok=True) print(f"Downloading: {object_key} -> {local_file_path}") if download_file(obs_client, bucket_name, object_key, local_file_path): ``` ### Technical Analysis The folder-download implementation derives a local destination directly from an OBS object key. Object keys are remote data and may be controlled by any principal with permission to create or rename objects in the selected bucket. Removing leading `/` characters does not remove `..` path components. Consequently, a key such as `shared/../../app/config.py`, when processed with `obs_prefix='shared/'`, produces the relative path `../../app/config.py`. Passing that value to `os.path.join()` allows the resulting path to resolve outside `local_folder_path`. The implementation then creates the destination's parent directories and calls the download function without verifying that the canonical destination remains inside the intended download root. It also does not require confirmation before overwriting an existing destination. ### Attack Path 1. An attacker obtains permission to upload or rename objects under a bucket or prefix processed by the victim. 2. The attacker creates an object with a traversal key, such as `shared/../../.ssh/authorized_keys`. 3. The victim calls `download_folder()` with `obs_prefix='shared/'` and a local download directory. 4. Prefix removal produces `../../.ssh/authorized_keys`. 5. `os.path.join() ...[truncated 829 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Treat every object key as untrusted input and verify the canonical destination before creating directories or downloading: ```python root = os.path.realpath(local_folder_path) destination = os.path.realpath(os.path.join(root, relative_path)) if os.path.commonpath([root, destination]) != root: raise ValueError(f"Unsafe object key: {object_key}") ``` Additionally: 1. Reject absolute paths and any key containing `..` path components. 2. Account for both POSIX and Windows path separators and drive-qualified paths. 3. Normalize the prefix and require every downloaded object to match it. 4. Avoid following symlinks within the destination tree, or use directory-relative file APIs with no-follow protections where available. 5. Refuse to overwrite existing files by default; require explicit caller authorization. 6. Download to a safely created temporary file inside the destination directory and atomically rename it after successful validation. 7. Add tests covering `../`, repeated traversal, absolute paths, Windows drive paths, mixed separators, encoded-looking names, and symlink escape scenarios. ]]>

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding
Open-Ended Dependency Constraints Allow Unreviewed Future Releases<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1-2`; related installation instruction at `SKILL.md:14` **Vulnerability Type**: Unpinned third-party dependencies and non-reproducible installation **Risk Level**: Medium ### Vulnerable Code `requirements.txt`: ```text huaweicloud-sdk-python-obs >= 3.22.12 python-dotenv >= 1.0.0 ``` Related installation instruction in `SKILL.md`: ```bash pip install huaweicloud-sdk-python-obs ``` ### Technical Analysis Both dependencies use open-ended lower bounds, while the documented installation command has no version constraint. The installation process can therefore select any future release satisfying the constraints without prior review. Python packages execute imported code in the Skill's process, and package installation may also involve build-time code depending on the selected distribution. If a dependency publisher account or distribution channel is compromised, a malicious future release could be selected automatically. No evidence was found that the current package names are typosquatted, that the configured package source is malicious, or that the reviewed minimum versions are compromised. The risk arises from trusting unknown future releases and from the absence of integrity verification. ### Attack Path 1. A dependency publisher account, package release process, or distribution channel is compromised. 2. An attacker publishes a newer release under one of the accepted package names. 3. A user installs the project using `requirements.txt` or follows the unconstrained command in `SKILL.md`. 4. The package resolver selects the malicious newer version because it satisfies the open-ended constraint. 5. Malicious code runs during package installation, package import, or subsequent OBS operations under the user's privileges. ### Impact Assessment A compromised dependency could execute arbitrary code with the privileges of the user or service installing and running the Skill. This coul ...[truncated 428 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin every direct dependency to an exact, reviewed version: ```text huaweicloud-sdk-python-obs==3.22.12 python-dotenv==1.0.0 ``` 2. Generate and commit a lock file that includes all transitive dependencies. 3. Record cryptographic hashes and install with `pip install --require-hashes`. 4. Update `SKILL.md` so its installation command uses the reviewed requirements or lock file rather than an unconstrained package name. 5. Perform dependency upgrades explicitly through a reviewed change process. 6. Run vulnerability and provenance checks in CI before accepting updated versions. 7. Install from an explicitly configured trusted package index and avoid fallback to untrusted indexes. 8. Prefer isolated, least-privileged build and runtime environments so dependency compromise cannot access unnecessary credentials or files. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This markdown file includes an example lifecycle configuration that automatically deletes objects after 365 days. Although the code comments describe the behavior, the surrounding documentation does not clearly warn users that applying this example can irreversibly remove stored data and affect retention obligations.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The example explicitly provides a helper that grants Group.ALL_USERS read access to a bucket, effectively making bucket contents publicly readable. In an object storage SDK guide, this is security-relevant because users may copy the snippet into production without understanding the privacy, data exposure, and compliance implications, and the document does not prominently warn about those risks.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The document shows operations that upload local files to OBS, download remote data locally, enumerate object metadata, and generate temporary access URLs, all of which can affect privacy or data exposure. The markdown description explains functionality but does not warn users that these examples interact with remote storage and may transfer or expose data.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
This markdown file documents `delete_object` and `delete_objects`, which remove stored objects, but it provides no warning that these actions are destructive and may permanently affect user data. Under the markdown-specific SQP-2 criteria, skills should disclose behaviors that can affect user data or system integrity.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This code performs safety-relevant remote operations: uploading local files to cloud storage, downloading objects to a local path, and deleting remote objects. The functions contain no confirmation prompt, warning print/log, or inline disclosure about these effects, so callers may invoke data-modifying actions without any user-visible notice from this skill file.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
Natural-language content throughout the skill forces a specific language presentation without offering an opt-in or explaining a region-specific requirement. Under the stated policy, language constraints should either be optional for the user or clearly justified.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
All headings, descriptions, and inline messages in the file are Chinese-only, which effectively forces a specific language for users consuming this skill documentation. SQP-3 calls for flagging language-policy issues when a skill imposes a language or locale without user opt-in or explicit justification.

Unpinned Dependencies

Low
Category
Supply Chain
Content
huaweicloud-sdk-python-obs >= 3.22.12
python-dotenv >= 1.0.0
Confidence
94% confidence
Finding
The dependency is specified with a lower-bound only (>= 3.22.12), which allows future unreviewed versions to be installed. This creates a supply-chain and reproducibility risk because builds may pull in unexpected releases, including ones with regressions or newly introduced vulnerabilities.

Unpinned Dependencies

Low
Category
Supply Chain
Content
huaweicloud-sdk-python-obs >= 3.22.12
python-dotenv >= 1.0.0
Confidence
97% confidence
Finding
The python-dotenv dependency is also unpinned and may resolve to different versions over time. Because this package has known advisories in some releases, leaving it unpinned increases uncertainty and the chance of installing an affected or otherwise unsafe version.

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding
The manifest includes python-dotenv without a fixed version, and the package has known advisories affecting some releases. Since the installed version cannot be verified from this manifest, there is a real risk that an affected version could be pulled in, especially in fresh or automated environments.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
The module docstrings, comments, and user-facing print messages are written in Chinese only, which imposes a specific language on users without any opt-in or alternative. This can violate language/locale policy when a skill should not force one language by default.

Static analysis

No suspicious patterns detected.