T09 · Insecure Skill Coding Practices
- Location
scripts/products_from_ticket_system.py:37- Finding
Ticket System signed requests can be redirected to an untrusted endpoint
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its stated Alibaba Cloud discovery purpose, but it can send signed credentialed requests to unvalidated endpoints from environment variables.
Install only if you are comfortable running local Python scripts with Alibaba Cloud credentials. Use short-lived, least-privilege credentials, verify every endpoint environment variable before execution, avoid untrusted product metadata files, and run the skill from a workspace where output writes cannot affect sensitive files.
scripts/products_from_ticket_system.py:37Ticket System signed requests can be redirected to an untrusted endpoint
scripts/products_from_support_service.py:58Support Service signed requests can be redirected to an untrusted endpoint
scripts/products_from_bssopenapi.py:42BSS OpenAPI endpoint override permits redirection of signed requests
scripts/apis_from_openapi_meta.py:74Untrusted product metadata can escape the configured output directory
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def fetch_json(url: str) -> dict:
try:
with urllib.request.urlopen(url, timeout=60) as resp:
payload = resp.read().decode("utf-8")
except urllib.error.URLError as exc:
print(f"Failed to fetch {url}: {exc}", file=sys.stderr)
The code’s primary function is a local comparison step: it loads merged_products.json, scans existing skill markdown files, matches products by name/code substring, and generates skill gap reports. This only partially aligns with the final part of the description about coverage/gap reporting for skill generation, but it does not implement the major declared capabilities of discovering/reconciling product catalogs from external Alibaba Cloud sources or fetching OpenAPI metadata. The actual behavior is narrower and materially different from the broader declared purpose.
The implementation is materially narrower than the declared description. It performs a single task: fetching paginated product data from the BSS OpenAPI QueryProductList endpoint and saving it locally. None of the broader declared behaviors—multi-source catalog discovery/reconciliation, OpenAPI metadata retrieval, or coverage/gap summarization—are present in this code chunk. This is a description-behavior mismatch because the declared primary purpose describes a larger workflow and set of capabilities than the code actually implements.
The declared description promises a broader catalog discovery and reconciliation workflow across several Alibaba Cloud sources, plus API metadata collection and coverage analysis for skill planning. The supplied code performs only one narrow part of that: downloading products.json from api.aliyun.com, extracting product codes and versions, and saving raw and normalized JSON files. There is no evidence of querying Ticket System, Support & Service, or BSS OpenAPI, no product-to-API mapping, and no reporting or summarization of coverage gaps. This is therefore a material underimplementation relative to the declared purpose.
The skill instructs execution of local Python scripts that inherently require file access, environment variable access, and network connectivity, but it declares no explicit tool scope or permission boundaries. In an agent environment, this can lead to over-broad execution authority and makes it harder to enforce least privilege or review what the skill is allowed to do.
The script hard-codes Chinese headings and column labels in the generated markdown report, which imposes a specific language choice on users. There is no option to select locale or explanation that this is a region-specific tool, so this is a natural-language policy concern.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""Fetch Alibaba Cloud product list from OpenAPI metadata endpoints.
Downloads:
https://api.aliyun.com/meta/v1/products.json?language=EN_US
Optional env vars:
- OPENAPI_META_LANGUAGE (default: EN_US)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""Fetch Alibaba Cloud product list from OpenAPI metadata endpoints.
Downloads:
https://api.aliyun.com/meta/v1/products.json?language=EN_US
Optional env vars:
- OPENAPI_META_LANGUAGE (default: EN_US)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""Fetch Alibaba Cloud product list from OpenAPI metadata endpoints.
Downloads:
https://api.aliyun.com/meta/v1/products.json?language=EN_US
Optional env vars:
- OPENAPI_META_LANGUAGE (default: EN_US)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""Fetch Alibaba Cloud product list from OpenAPI metadata endpoints.
Downloads:
https://api.aliyun.com/meta/v1/products.json?language=EN_US
Optional env vars:
- OPENAPI_META_LANGUAGE (default: EN_US)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""Fetch Alibaba Cloud product list from OpenAPI metadata endpoints.
Downloads:
https://api.aliyun.com/meta/v1/products.json?language=EN_US
Optional env vars:
- OPENAPI_META_LANGUAGE (default: EN_US)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""Fetch Alibaba Cloud product list from OpenAPI metadata endpoints.
Downloads:
https://api.aliyun.com/meta/v1/products.json?language=EN_US
Optional env vars:
- OPENAPI_META_LANGUAGE (default: EN_US)
The manifest and workflow consistently describe fetching, merging, and summarizing Alibaba Cloud product and OpenAPI metadata, with outputs written locally under output/. Line L100 introduces 'mutating operations', which contradicts the apparent read-only intent of the skill and suggests capabilities not otherwise described in the file.
The generated report headers and labels are hard-coded in Chinese, which imposes a specific language choice on users of the skill. There is no option to select another language and no documentation in the file indicating that the skill is intentionally region-specific.
This code performs an HTTP API request to the Support service using environment-supplied credentials, but the runtime behavior is only implied by the module docstring and there is no explicit user-facing notice at the point of execution about contacting a remote service. For code files, outbound network activity that may transmit user or system data should have some visible disclosure such as a print/log statement, confirmation, or clearly stated warning.
The generated markdown uses fixed Chinese headers and labels such as "产品Code", "产品名", and "OpenAPI 产品分类汇总". This imposes a specific language/locale in user-facing output without opt-in or documentation justifying a Chinese-only audience, matching the language policy violation criteria.