T09 · Insecure Skill Coding Practices
- Location
scripts/query_Config_resource_summary.py:10- Finding
SQL Injection Through Unvalidated Resource Summary Filters
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a disclosed Huawei Cloud Config helper that performs read-only inventory and compliance-related queries using user-provided Huawei Cloud credentials, with scoping and dependency-hygiene caveats.
Install and use this only in a trusted environment with Huawei Cloud credentials limited to Config ReadOnlyAccess. Avoid giving it broad account keys, do not pass untrusted values into provider, region, resource type, or SQL parameters, and consider pinning SDK dependency versions before installation.
scripts/query_Config_resource_summary.py:10SQL Injection Through Unvalidated Resource Summary Filters
SKILL.md:50Unpinned Third-Party Dependencies in Installation Instructions
The code is clearly related to Huawei Cloud Config and does support part of the declared scope: schema queries, SQL condition queries, and some compliance-related querying via built-in policy definitions. However, the description claims a broader assistant that provides global resource queries, resource configuration queries, resource relationship/asset inventory style querying, and general compliance checking capabilities. In the supplied code chunk, there are no functions for fetching specific resources, querying resource configurations directly, enumerating global resources broadly, or analyzing relationships. The primary purpose is aligned at a high level, but the implemented functionality is substantially narrower than the declared description, so this is a description/behavior mismatch due to overclaiming capabilities.
The activation criteria are extremely broad and mandate use of this skill for many generic Huawei Cloud resource-management, audit, and compliance scenarios, even when Config is not explicitly requested. Overbroad triggering can route unrelated user requests into a credentialed cloud-query workflow, causing unnecessary access to cloud metadata and increasing the chance of overcollection, privacy leakage, or execution in the wrong context.
The skill requires access to sensitive environment variables (HUAWEICLOUD_AK/SK) and performs networked cloud queries, but it does not declare any explicit tool scope or permission boundaries. This increases the risk of overbroad execution, unintended secret exposure, or use of tools beyond what the user expects, especially because the skill is designed to handle cloud inventory and compliance workflows.
The skill name and description are entirely Chinese and present the assistant as a fixed Chinese-language helper, with no indication that users may choose another language. Under the stated policy, language constraints should be opt-in or explicitly justified as region-specific.
The client initialization pulls HUAWEICLOUD_AK and HUAWEICLOUD_SK from environment variables, which is access to sensitive credentials. While the code handles request errors, it provides no comment, docstring, or other disclosure explaining that the skill depends on and accesses cloud secrets.
The code forces request.x_language = "zh-cn", which imposes a specific locale on responses. There is no visible user opt-in, configurability, or justification that this skill is intended only for a Chinese-language or region-specific context.
The user-facing argparse description and option help strings are written only in Chinese, which imposes a specific language on all users of the skill. The file does not provide an English alternative, language selection, or any justification that this is a China-only or locale-specific tool.
This code issues a query through query_Config_resource_by_sql(sql) and imports requests, indicating remote access to configuration data, but the script provides no user-facing notice that it will contact an external service or retrieve potentially sensitive infrastructure metadata. Aside from the brief argparse description, there is no confirmation prompt, logging, or explanatory warning in the file about this behavior.
This JSON file includes many Chinese-language description strings alongside English names, but it does not indicate that the skill is region-specific or provide any opt-in/choice for language or locale. Under the language/locale policy rule, forcing a specific language experience without user choice can be a policy concern when the constraint is undocumented.