Back to skill

Security audit

huawei-cloud-cloudrobo-npu-patcher

Security checks for vulnerabilities and agentic risk

Overview

This skill needs review because verification permits model-supplied code execution without a separate opt-in, and training disables a network safeguard.

Before use, require explicit approval for custom model code, restore peer allowlisting or restrict training networking, and review the automatic cache cleanup. Use reviewed model repositories in an isolated environment without unrelated secrets, inspect proposed code changes, and test actual dataset loading separately. This static review found no supported evidence of credential theft or a backdoor; external model code and host configuration remain unverified.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
templates/env_npu.sh:49
Finding

Training environment disables HCCL peer allowlisting

Content
View full analysis

Impact

Non-allowlisted hosts are no longer rejected by this IP admission control, exposing distributed-training communication endpoints to unauthorized connection attempts and potential training disruption. This does not establish arbitrary code execution or defeat any separate network controls.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (11)

Pipeline checks enable execution of model-supplied Python code without disclosing that behavior to the user.

High
Category
Output Handling
Confidence
98% confidence
Finding

Both loaders explicitly enable trust_remote_code, allowing model-supplied Python to execute during what is presented as a pipeline availability check. A malicious model directory or referenced custom implementation could execute with the verifier's privileges, exposing accessible files, credentials, and compute resources.

Content

No source excerpt is available for this finding.

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

python
# Directory/file exclusions
    # =========================================================================
    exclude_dirs: set[str] = field(default_factory=lambda: {
        'venv', '.venv', 'env', '.env', 'site-packages',
        '__pycache__', '.git', 'build', 'dist', 'node_modules',
    })

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 · templates/env_npu.sh (reported line 36)May include surrounding context.

sh
egments:True"

# Performance (critical — do not remove)
export TASK_QUEUE_ENABLE=2        # pipeline optimization
export COMBINED_ENABLE=1          # operator fusion
export CPU_AFFINITY_CONF=1        # core binding
export ACLNN_CACHE_LIMIT=100000   # operator cache
export ACL_OP_INIT_MODE=0         # lazy initialization

# tcmalloc (10-20% speedup)
[[ -f /usr/lib64/libtcmalloc.so.4 ]] && export LD_PRELOAD=/usr/lib64/libtcmalloc.so.4

export MULTI_STREAM_MEMORY_REUSE=1        # multi-stream memory reuse
export HOST_CACHE_CAPACITY=20             # dynamic shape cache
export HCCL_OP_BASE_FFTS_MODE_ENABLE=TRUE # HCCL FFTS+ optimization
export ASCEND_ENHANCE_enable=1            # Ascend enhancement mode

# Logging (suppress verbose output)
export ASCEND_SLOG_PRINT_TO_STDOUT=0
export ASCEND_GLOBAL_LOG_LEVEL=3
export ASCEND_GLOBAL_EVENT_ENABLE=0

# HCCL distributed training
export HCCL_WHITELIST_DISABLE=1
export HCCL_IF_IP="${HCCL_IF_IP:-$(hostname -I | awk '{print $1}')}"
export HCCL_CONNE

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

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 documented dataset-loading verification only tokenizes synthetic text and never loads a dataset.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The module documentation explicitly claims to use HuggingFace datasets or a custom dataset loader, and the function promises to test actual data loading (L022). Instead, L047–L067 only tokenize generated strings and report success, so broken dataset access, custom loaders, or preprocessing pipelines can remain undetected despite a passing data-loading check.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 · templates/train.sh (reported line 83)May include surrounding context.

sh
# =============================================================================
# Start training (pass through "$@")
#   --foreground: run in the foreground (logs straight to the terminal)
#   default: nohup background run; logs tee'd to OUTPUT_DIR/train.log AND
#            streamed to this terminal in real time
# =============================================================================
cd "${PROJECT_ROOT}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 · templates/train.sh (reported line 94)May include surrounding context.

sh
# are written to train.log AND echoed to the terminal. `$!` is the
    # training process PID (not tee's), so `kill $(cat train.pid)` still
    # stops training.
    nohup "$@" > >(tee "${OUTPUT_DIR}/train.log") 2>&1 &

    PID=$!
    echo "${PID}" > "${OUTPUT_DIR}/train.pid"

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/checks/build.py (reported line 48)May include surrounding context.

python
model_class_name = cfg.get('model', '').get('type', '') if isinstance(cfg.get('model'), dict) else ''
        if model_class_name:
            module = importlib.import_module(cfg.get('model', {}).get('module', ''))
            model_class = getattr(module, model_class_name)
            model = model_class(**cfg.get('model', {}).get('args', {}))
            return model

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

python
def _unpickle_dtype(name):
    return getattr(torch, name)


def _safe_from_numpy(arr, *args, **kwargs):

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/scanners/__init__.py (reported line 65)May include surrounding context.

python
def _collect_scanners(module) -> list:
    return [
        getattr(module, name)
        for name in dir(module)
        if name.startswith('scan_p_')
    ]

The documented pass-through-only wrapper also recursively deletes project Python caches.

Low
Category
Excessive Agency
Confidence
94% confidence
Finding

Despite the pass-through-only description, every launch recursively removes all directories named pycache beneath the project root. These normally contain disposable bytecode, which limits impact, but unconditional recursive deletion can remove unexpected contents and affect unrelated nested environments without explicit consent.

Content

No source excerpt is available for this finding.