Back to skill

Security audit

Package Track

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent package-tracking skill, but it can send shipment details and API credential-derived request data over an under-disclosed plaintext sandbox endpoint.

Review this skill before installing if you will use real shipment numbers, phone suffixes, or production Kdniao credentials. Avoid sandbox mode unless you understand it uses plaintext HTTP, and prefer restricting configuration to trusted HTTPS Kdniao endpoints.

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
package_tracker/kdniao.py:18
Finding
Plaintext HTTP Transport Exposes Sandbox Tracking Data## Vulnerability Details **File Location**: `package_tracker/kdniao.py:18`, `package_tracker/kdniao.py:62-76`, and `package_tracker/kdniao.py:83-106`; related default configuration at `package_tracker.json:7-10` **Vulnerability Type**: Sensitive data transmitted over unencrypted HTTP **Risk Level**: Medium ### Vulnerable Code ```python KDNIAO_API_URL = "https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx" KDNIAO_SANDBOX_URL = "http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInvoke.json" ``` ```python def __init__( self, ebusiness_id: str | None = None, api_key: str | None = None, sandbox: bool = False, request_type: str | None = None, api_url: str | None = None, sandbox_url: str | None = None, ): self.ebusiness_id = ebusiness_id or "" self.api_key = api_key or "" self.request_type = request_type or KDNIAO_REQUEST_TYPE_TRACK resolved_api_url = api_url or KDNIAO_API_URL resolved_sandbox_url = sandbox_url or KDNIAO_SANDBOX_URL self.base_url = resolved_sandbox_url if sandbox else resolved_api_url if not self.ebusiness_id or not self.api_key: raise ValueError( "Kdniao requires EBusinessID and ApiKey. " "Provide them via JSON config (providers.kdniao) or pass to constructor." ) ``` ```python def track( self, shipper_code: str, logistic_code: str, order_code: str = "", customer_name: str = "", **kwargs: Any, ) -> dict[str, Any]: body = _request_body( self.ebusiness_id, self.api_key, shipper_code, logistic_code, request_type=self.request_type, order_code=order_code, customer_name=customer_name, ) req = urllib.request.Request( self.base_url, data=body, method="POST", headers={"Content-Type": "application/x-www-form-urlencod ...[truncated 2854 chars]
Remediation
## Remediation Suggestions 1. Replace the sandbox URL with an official HTTPS endpoint if Kdniao provides one. 2. Validate `api_url` and `sandbox_url` during initialization and reject every scheme other than `https`. 3. Consider restricting endpoint hosts to an explicit allowlist of trusted Kdniao domains to prevent credentials and shipment data from being redirected to attacker-controlled servers. 4. If no HTTPS sandbox exists, disable sandbox networking by default and require explicit acknowledgement before permitting plaintext transport. 5. Never permit production credentials, real tracking numbers, order references, or customer information to be used with a plaintext sandbox. 6. Document that URL encoding and Base64 signing do not protect request confidentiality. 7. Add automated tests confirming that HTTP and unsupported URL schemes are rejected. Example hardening: ```python from urllib.parse import urlparse def _validate_endpoint(url: str) -> str: parsed = urlparse(url) if parsed.scheme.lower() != "https": raise ValueError("Kdniao endpoints must use HTTPS") if parsed.hostname not in { "api.kdniao.com", "sandboxapi.kdniao.com", }: raise ValueError("Untrusted Kdniao endpoint host") return url resolved_api_url = _validate_endpoint(api_url or KDNIAO_API_URL) resolved_sandbox_url = _validate_endpoint(sandbox_url or KDNIAO_SANDBOX_URL) ```
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill explicitly describes network-backed package tracking and references a live third-party API, but it does not declare any tool scope or allowed network permissions. This creates a capability-transparency gap: users and the hosting agent may invoke a skill that transmits tracking numbers and related data externally without an explicit permission boundary.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The activation text is broad enough to match common requests such as general logistics, parcel lookups, or integration help, which can cause the skill to trigger in contexts beyond the user's clear intent. Over-broad routing increases the chance that sensitive shipment identifiers or phone-derived data are sent to an external provider unnecessarily.

External Transmission

Medium
Category
Data Exfiltration
Content
## Provider: 快递鸟 (Kdniao)

- **即时查询** RequestType: `1002`
- **Endpoint**: `https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx`
- **RequestData** (JSON): `ShipperCode`, `LogisticCode`, optional `OrderCode`, optional `CustomerName` (required for 顺丰 SF: last 4 digits of phone)
- **Sign**: `RequestData` (unencoded JSON, no spaces) + ApiKey → MD5 → Base64 → URL-encode
Confidence
89% confidence
Finding
The skill is designed to send shipment data to a third-party endpoint, including tracking numbers and optionally customer-related fields such as the last four digits of a phone number for SF queries. In this context, external transmission is expected, but it is still security-relevant because operational and personal data leave the agent boundary and are exposed to third-party handling, logging, and misuse if invoked without informed consent.

External Transmission

Medium
Category
Data Exfiltration
Content
# 即时查询
KDNIAO_REQUEST_TYPE_TRACK = "1002"
KDNIAO_API_URL = "https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx"
KDNIAO_SANDBOX_URL = "http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInvoke.json"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
# 即时查询
KDNIAO_REQUEST_TYPE_TRACK = "1002"
KDNIAO_API_URL = "https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx"
KDNIAO_SANDBOX_URL = "http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInvoke.json"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The code transmits shipment identifiers and an optional customer name to a third-party logistics API, which is a real data-exposure/privacy concern if users are not clearly informed or if consent is not obtained upstream. In the context of a package-tracking skill this transmission is expected for functionality, but customer names and tracking data are still sensitive operational data and disclosure/consent controls are not visible in this file.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The trigger list includes Chinese-specific terms like '快递鸟' and '快递查询' without clarifying whether the skill is intended for Chinese-language use only or whether multilingual invocation is supported. This can create an implicit locale preference without explicit user opt-in or documented justification.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The command prints user-facing status messages in Chinese (e.g. 查询失败, 状态, 轨迹) while other interface text is in English, and there is no option to select the output language. This can violate a language/locale policy when tools must not force a specific language without user opt-in.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
This file contains natural-language documentation exclusively in Chinese, including the module docstring and function docstrings/comments. Under the language/locale policy rule, forcing a specific language without opt-in or a documented region-specific justification can be a policy issue.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The file’s natural-language documentation is entirely in Chinese, including the module docstring and function docstring, with no indication that language selection is configurable or that the skill is intentionally region-specific. This can violate a language/locale policy when users are not given an opt-in or alternative language.

Static analysis

No suspicious patterns detected.