Back to skill

Security audit

huaweicloud-python-sdk-helper

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate Huawei Cloud SDK lookup helper, but one helper command can load arbitrary local Python modules from user input.

Review before installing or using in automated agent workflows. Run it only in a dedicated virtual environment with trusted Huawei SDK packages installed, avoid passing arbitrary dotted --class values from untrusted text, and prefer pinned package versions from a trusted index.

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

Warning
Location
scripts/query_sdk_methods.py:327
Finding

Unrestricted Module Import Through the --class Argument

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:176
Finding

Unpinned Third-Party Package Installation Instructions

Content
View full analysis
-i https://mirrors.tools.huawei.com/pypi/simple # 或安装全部:pip install huaweicloudsdkall ``` ### Technical Analysis The installation instructions request packages without pinning reviewed versions or verifying artifact hashes. Consequently, the installed code can change over time even when users follow the same command. The service-specific command identifies a Huawei-hosted package index, but it still accepts the latest matching package and transitively resolved dependencies. The aggregate-package command does not specify an index and therefore uses the environment's configured default package source. Neither instruction provides a lock file, hashes, or an integrity-verification procedure. This is a supply-chain hardening weakness rather than evidence that the named dependencies are currently malicious. Exploitation depends on compromise of a package, package index, dependency, or package-resolution configuration. ### Attack Path 1. A user or Agent follows the installation instructions in `SKILL.md`. 2. `pip` resolves the latest available package and its transitive dependencies rather than a previously audited version. 3. An attacker compromises a dependency release, the selected package source, or the environment's configured default index. 4. `pip` obtains the attacker-controlled artifact because no reviewed version or cryptographic hash is enforced. 5. Package installation hooks or subsequent imports execute the introduced code with the privileges of the installing or running process. ### Impact Assessment A compromised package could execute code during installation or when the query script dynamically imports Huawei SDK packages. Such code would inherit the privileges of the user or Agent performing the installation or running the ...[truncated 383 chars]
Remediation
View remediation
==" \ --index-url https://mirrors.tools.huawei.com/pypi/simple ``` 2. Provide a lock file or requirements file containing exact versions for direct and transitive dependencies. 3. Generate and publish cryptographic hashes for approved artifacts, then require them during installation: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. Use the intended package index consistently rather than relying on the environment's default index for `huaweicloudsdkall`. 5. Recommend installation in a dedicated virtual environment with minimum operating-system privileges. 6. Establish a documented dependency-review and update process so version and hash changes are explicitly reviewed before users adopt them. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (15)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description is entirely in Chinese and presents the tool as a Chinese-language helper, with no indication that users may interact in other languages or opt into Chinese output. Under the policy, language constraints should either be optional or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file shows how to construct credentials using access key, secret key, and security token variables, but it provides no caution about treating these values as sensitive secrets. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect privacy or system integrity; exposing or mishandling credentials is a relevant user-safety concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This file contains natural-language instructions, descriptions, and examples exclusively in Chinese, with no indication that users may choose another language. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

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

python
for name in dir(mod):
            if not name.endswith('Client'):
                continue
            obj = getattr(mod, name)
            # 只保留类,排除 AsyncClient(后续按需求可单独处理)
            # 这里先收集所有 Client
            if inspect.isclass(obj):

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

python
try:
            mod = importlib.import_module(source_module)
            if hasattr(mod, class_name):
                req_class = getattr(mod, class_name)
            else:
                # 尝试从 model 子模块
                try:

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

python
try:
                    model_mod = importlib.import_module(f"{module_to_import}.model")
                    if hasattr(model_mod, class_name):
                        req_class = getattr(model_mod, class_name)
                    else:
                        return params
                except Exception:

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

python
return params
                except Exception:
                    # 尝试直接请求类作为属性
                    req_class = getattr(mod, class_name, None)
                    if not req_class:
                        return params
        except Exception:

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

python
for attr_name, attr_type in openapi_types.items():
            # 获取属性描述(如果有 setter docstring)
            # 尝试获取 getter/setter
            setter = getattr(req_class, f'{attr_name}', None)
            prop_type = attr_type if isinstance(attr_type, str) else str(attr_type)
            
            # 查找 setter 的 docstring

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

python
# 查找 setter 的 docstring
            setter_doc = ''
            prop = getattr(req_class, attr_name, None)
            if hasattr(prop, 'fset') and prop.fset:
                setter_doc = inspect.getdoc(prop.fset) or ''

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

python
try:
            mod = importlib.import_module(mod_name)
            if hasattr(mod, class_name):
                target_class = getattr(mod, class_name)
                target_module_path = f"{mod_name}.{class_name}"
                break
        except Exception:

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

python
try:
            mod = importlib.import_module(mod_name)
            if hasattr(mod, class_name):
                target_class = getattr(mod, class_name)
                target_module_path = f"{mod_name}.{class_name}"
                break
        except Exception:

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

python
module_path = '.'.join(class_name.split('.')[:-1])
            cls_name = class_name.split('.')[-1]
            mod = importlib.import_module(module_path)
            target_class = getattr(mod, cls_name, None)
            if target_class:
                target_module_path = class_name
        except Exception:

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

python
try:
                                model_mod = importlib.import_module(f"{pkg}.{ver}.model")
                                if hasattr(model_mod, class_name):
                                    target_class = getattr(model_mod, class_name)
                                    target_module_path = f"{pkg}.{ver}.model.{class_name}"
                                    break
                            except Exception:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The argparse description, epilog examples, and argument help strings are all presented solely in Chinese. This continues the same language-policy issue in the executable interface, with no opt-in or alternate locale path.

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

python
full_module_name = f"{sdk_name}.{version}"
    try:
        mod = importlib.import_module(full_module_name)
        client_class = getattr(mod, args.client, None)
        if not client_class:
            print(f"❌ 在 {full_module_name} 中未找到 Client 类: {args.client}")
            # 尝试列出可用的 Client