Back to skill

Security audit

huawei-cloud-obs-dir-count

Security checks for vulnerabilities and agentic risk

Overview

The folder counter is read-only, but its verification runner permits commands that exceed the skill’s stated safety limits.

Review before installing. Use credentials restricted to listing the intended buckets, and avoid the verification runner until it is limited to fixed read-only operations. The supplied tests are harmless, but its command filter does not guarantee that. Obtain the CLI and matching checksum from Huawei’s official page, configure credentials outside chat without exposing them in history, and confirm test bucket names before running checks. All bundled files were inspected; live cloud behavior and downloaded binaries remain unverified.

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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (12)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill's broad read-only and tool-scope declarations do not hold for the referenced automated verification workflow: its runner permits general hcloud, curl, Bash, and Python commands from test data. This creates an execution path beyond directory counting, although the primary counting script itself uses fixed listing operations.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
60% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 36)May include surrounding context.

md
cd ~/Downloads

# --- x86_64 ---
curl -fLO https://obs-community-tool.obs.cn-north-1.myhuaweicloud.com/hcloudcli/latest/hcloudcli-linux-amd64.tar.gz

# --- ARM64 (e.g. Huawei Kunpeng, Apple Silicon via macOS) ---
curl -fLO https://obs-community-tool.obs.cn-north-1.myhuaweicloud.com/hcloudcli/latest/hcloudcli-linux-arm64.tar.gz

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 103)May include surrounding context.


3. Add to PATH (user-level)

Extract and install into your user home without sudo:

Linux / macOS

bash
cd ~/Downloads
tar -xzf hcloudcli-linux-amd64.tar.gz
chmod +x hcloud

# Install into your user-local bin (create it if needed)
mkdir -p ~/.local/bin
mv hcloud ~/.local/bin/hcloud
chmod +x ~/.local/bin/hcloud

# Add ~/.local/bin to PATH for the current shell (and persist it)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
export PATH="$HOME/.local/bin:$PATH"

zsh users: append the same line to ~/.zshrc instead.

Windows (PowerShell)

powershell
Expand-Archive "$HOME\Downloads\hcloudcli.zip" -DestinationPath "$HOME\hcloudcli"
# Add "$HOME\hcloudcli" to your user PATH via System Settings > Environment Variables.

4. Configure obsutil credentials

The hcloud OBS module uses obsutil, which needs its own AK/SK and endpoint. Run this in your own terminal (never paste AK/SK into a chat):

bash
hcloud obs con

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/test-cli-commands.sh (reported line 9)May include surrounding context.

sh
#
# Executes the test cases in templates/test-vars.json against the count script.
# Every command is validated against a strict allow-list before execution:
#   - first word must be hcloud | python3 | curl | bash
#   - no `bash -c`, no $ or backtick, no shell concatenation/redirect/subshell
#   - python3 commands must not call os.system/os.popen/subprocess/eval/exec
# Live count cases require a real OBS bucket (see templates/test-vars.json).

Chaining Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/test-cli-commands.sh (reported line 9)May include surrounding context.

sh
#
# Executes the test cases in templates/test-vars.json against the count script.
# Every command is validated against a strict allow-list before execution:
#   - first word must be hcloud | python3 | curl | bash
#   - no `bash -c`, no $ or backtick, no shell concatenation/redirect/subshell
#   - python3 commands must not call os.system/os.popen/subprocess/eval/exec
# Live count cases require a real OBS bucket (see templates/test-vars.json).

The test runner permits cloud-modifying commands and arbitrary network requests, beyond read-only OBS directory counting.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The validator restricts executable names but not their actual capabilities: test data can request mutating hcloud operations, curl uploads of readable files, or execution of arbitrary local scripts. A malicious test-case entry can therefore run actions with the user's credentials and filesystem access despite the runner's claimed restrictions; blocking some shell syntax and Python strings is not a sandbox.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

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 · references/cli-installation-guide.md (reported line 98)May include surrounding context.

md
chmod +x hcloud

# Install into your user-local bin (create it if needed)
mkdir -p ~/.local/bin
mv hcloud ~/.local/bin/hcloud
chmod +x ~/.local/bin/hcloud

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

python
if extra:
        cmd.extend(extra)
    try:
        proc = subprocess.run(
            cmd,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,

Runtime messages are required to use English-first text with Chinese hints without user language opt-in.

Low
Category
Output Handling
Confidence
96% confidence
Finding

The language policy specifies English-first runtime messages followed by Chinese hints, without offering a language choice or justifying this fixed language requirement. The workflow also instructs the agent to relay these bilingual failure messages, making this a user-facing language constraint rather than merely a description of documentation language.

Content

No source excerpt is available for this finding.

Excessive Permissions

Low
Category
Privilege Escalation
Confidence
80% confidence
Finding

Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.

Content

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

md
Ensure the IAM user holds OBS **read-only** permissions. See
`references/iam-policies.md` for full policy JSON.

**Minimum required permissions:**
- `obs:bucket:ListAllMyBuckets` — list buckets (v3) / `obs:bucket:listAllMyBuckets` (v5)
- `obs:bucket:ListBucket` — list objects (v3) / `obs:bucket:listBucket` (v5)
- `obs:bucket:GetBucketMetadata` — bucket attributes (v3) / `obs:bucket:getBucketMetadata` (v5)

The verification criteria require English-first error messages without user language opt-in.

Low
Category
Output Handling
Confidence
97% confidence
Finding

The document defines correct failure behavior as an English-first bilingual message, and reiterates the English-first requirement for authentication failures at lines 84–85. This imposes a specific output language preference without offering a user choice or documenting a justification for the constraint.

Content

No source excerpt is available for this finding.