Back to skill

Security audit

huawei-cloud-obs-image-desens

Security checks for vulnerabilities and agentic risk

Overview

Automatic processing can overwrite original images and repeatedly trigger cloud charges, while the required telemetry tool needs separate review.

Avoid automatic mode until it preserves originals, prevents repeated triggering, and correctly implements region redaction. Keep backups and restrict permissions to dedicated image locations. Before installation, review and verify the telemetry CLI; its reporting behavior remains unverified despite the documented off switch. Test redaction on sample images before relying on it for sensitive information. The evidence supports Review, without establishing intentional malicious behavior.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/obs_image_desens.py
Finding

Cloud resource creation bypasses the documented confirmation gate

Content
View full analysis

Impact

Direct invocation can provision billable resources and install an ongoing upload-processing trigger without an explicit confirmation step.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/obs_image_desens.py
Finding

Automatic processing writes back into its own ObjectCreated trigger

Content
View full analysis

Impact

Each successful PutObject can generate another matching creation event, producing a self-triggering processing loop, repeated image degradation, and sustained cloud usage and charges.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (19)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

An unrelated downloadable CLI is made mandatory for image-processing and cloud commands, creating an additional software trust boundary. The claim that it is undisclosed is overstated because the body mentions it, and this source does not show the download endpoints, but its compulsory use still exposes sensitive operations to unnecessary third-party code.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The document requires installing an unrelated quality CLI and routing operational commands through it, expanding the trusted execution chain beyond image processing. Although this dependency is disclosed in the body, mandatory installation and command interception introduce supply-chain exposure in an environment holding cloud credentials and sensitive image paths; the persistent installation details are not independently visible in this source.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The local batch behavior substantially matches the description. The automatic handler materially differs: its put_object call uses the same bucket and key as get_object, causing an undisclosed destructive replacement of the source image. With an ObjectCreated trigger covering that key, this write can also retrigger processing because no output exclusion or recursion guard exists. Additionally, the handler branches only on RULE == "blur"; all other rules, including region-blur and region-block, become whole-image pixelation. These are substantive differences in output handling and advertised processing behavior, not unrelated or malicious functionality.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The OBS resource scope is consistent with the description, but the supplied command does not substantiate the skill's specialized primary purpose. It delegates an unspecified OBS operation through a CLI wrapper rather than performing the described workflow. This assessment is limited to the supplied chunk; implementation elsewhere could change the conclusion.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The installation example pipes a mutable remote shell script directly into Bash without authenticating a pinned artifact. A compromised distribution endpoint could execute arbitrary commands with the user's privileges, potentially accessing cloud credentials; HTTPS and a vendor-associated hostname do not provide independent release integrity verification.

Content

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

md
| CLI Tool | Purpose | Installation |
|----------|---------|-------------|
| KooCLI (hcloud) | OBS obsutil module mapping: `hcloud obs ls/cp` | `curl -sSL https://cn-north-4-hcs-cloud-cdn.obs.cn-north-4.myhuaweicloud.com/install_cli.sh \| bash` (see [KooCLI docs](https://support.huaweicloud.com/qs-hcli)) |

## KooCLI

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/ensure_cli.sh (reported line 16)May include surrounding context.

sh
API_URL="https://skillsapi.developer.myhuaweicloud.com/api/quality/cli/latest"
OBS_BASE="https://obs-skills-repository.obs.cn-north-4.myhuaweicloud.com/skill-quality-cli"

V=$(curl -s "${API_URL}" | python3 -c 'import sys,json;print(json.load(sys.stdin)["version"])' 2>/dev/null)
if [ -z "$V" ]; then
    echo "警告: 无法获取 skill-quality-cli 最新版本,跳过安装" >&2
    exit 0

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/install_cli.sh (reported line 12)May include surrounding context.

sh
API_URL="https://skillsapi.developer.myhuaweicloud.com/api/quality/cli/latest"
OBS_BASE="https://obs-skills-repository.obs.cn-north-4.myhuaweicloud.com/skill-quality-cli"

V=$(curl -s "${API_URL}" | python3 -c 'import sys,json;print(json.load(sys.stdin)["version"])' 2>/dev/null)
if [ -z "$V" ]; then
    echo "无法获取 skill-quality-cli 最新版本" >&2
    exit 1

Automatic desensitization overwrites source objects instead of writing results to a target bucket/prefix.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The generated handler uploads processed bytes to the same bucket and key it downloaded, potentially destroying the original image when recoverable versions or backups are unavailable. With the default ObjectCreated trigger, the handler's own writes can trigger further invocations, causing repeated image degradation, excessive cloud charges, and resource exhaustion.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, 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.

The skill requires unrelated quality telemetry for image-desensitization operations.

Medium
Category
Excessive Agency
Confidence
94% confidence
Finding

The skill mandates a telemetry wrapper around cloud and processing commands even though reporting is unrelated to desensitization. That wrapper receives operational arguments and may access command output and inherited environment variables, creating unnecessary privacy exposure; this source does not establish which data is actually transmitted.

Content

No source excerpt is available for this finding.

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

export HUAWEI_PROJECT_ID="your-project-id"

text

**Security rules**: never echo AK/SK; never ask the user to paste AK/SK into the conversation;
reuse environment/`hcloud` configured credentials where possible.

### 5. IAM Permissions

Installs an unrelated quality-assessment CLI persistently in the user's executable directory.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The bootstrapper downloads an unpinned quality-CLI archive and installs executable code into the user's persistent executable directory without signature or checksum verification. A compromised release service or artifact could supply code that later runs with access to cloud credentials, despite being unrelated to image desensitization.

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 · scripts/ensure_cli.sh (reported line 35)May include surrounding context.

sh
tar xzf "${TMPDIR}/sqc.tar.gz" -C "${TMPDIR}"

mkdir -p ~/.local/bin/skill-quality-cli.d
cp "${TMPDIR}/skill-quality-cli" ~/.local/bin/ 2>/dev/null
cp "${TMPDIR}/skill-quality-cli.bin" ~/.local/bin/ 2>/dev/null
cp "${TMPDIR}/skill-quality-cli.d/cli_entry.py" ~/.local/bin/skill-quality-cli.d/ 2>/dev/null

Installs an unrelated skill-quality CLI outside the image-desensitization workflow.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

Although manually invoked, this installer retrieves the latest unrelated CLI archive and installs its executable components without verifying authenticity or pinning a reviewed release. Compromise of the release infrastructure could place attacker-controlled code in the user's executable directory, where later execution could expose cloud credentials.

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 · scripts/install_cli.sh (reported line 25)May include surrounding context.

sh
curl -fsSL -o "${TMPDIR}/sqc.tar.gz" "${OBS_BASE}/v${V}/skill-quality-cli-v${V}-linux-${ARCH}.tar.gz"
tar xzf "${TMPDIR}/sqc.tar.gz" -C "${TMPDIR}"

mkdir -p ~/.local/bin/skill-quality-cli.d
cp "${TMPDIR}/skill-quality-cli" ~/.local/bin/ 2>/dev/null
cp "${TMPDIR}/skill-quality-cli.bin" ~/.local/bin/ 2>/dev/null
cp "${TMPDIR}/skill-quality-cli.d/cli_entry.py" ~/.local/bin/skill-quality-cli.d/ 2>/dev/null

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

python
def run_cmd(cmd, capture=True):
    log("run: %s" % " ".join(str(c) for c in cmd))
    proc = subprocess.run([str(c) for c in cmd], capture_output=capture, text=True)
    if proc.returncode != 0:
        raise RuntimeError("command failed (%s): %s" % (proc.returncode, (proc.stderr or "").strip()[:500]))
    return (proc.stdout or "")

Automatic mode accepts region-specific rules but silently replaces them with full-image mosaic.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Automatic mode accepts region, region-blur, and region-block rules, but the generated handler implements only blur and a full-image mosaic fallback; it never applies the requested regions or solid occlusion. In a privacy-protection skill, silently replacing solid redaction with a coarse mosaic can leave sensitive information recognizable while also unnecessarily altering the entire image.

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 · scripts/obs_image_desens.py (reported line 414)May include surrounding context.

python
img = _pixelate(img)
        buf = BytesIO()
        img.save(buf, format=img.format or "PNG")
        s3.put_object(Bucket=bucket, Key=key, Body=buf.getvalue())
        desens.append({"bucket": bucket, "key": key})
    return {"desensitized": desens}
''' % {

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% 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 · scripts/obs_image_desens.py (reported line 448)May include surrounding context.

python
p_proc.add_argument("--radius", type=int, default=8, help="Gaussian blur radius")
    p_proc.add_argument("--regions", default="", help="regions 'x0,y0,x1,y1[;x0,y0,x1,y1]'")
    p_proc.add_argument("--fill", default="black", help="region-block fill color")
    p_proc.add_argument("--yes", action="store_true", help="skip confirmation")
    p_proc.set_defaults(command="process")

    p_trig = sub.add_parser("setup-trigger",