Back to skill

Security audit

Cn Express Tracker

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent package-tracking helper that uses Kuaidi100 as expected, with privacy and credential-handling caveats users should understand.

Install only if you are comfortable sending tracking numbers and your Kuaidi100 customer identifier to Kuaidi100. Prefer temporary environment variables or a protected secrets manager instead of putting API keys in shell startup files, and avoid submitting untrusted or unusual tracking strings until input validation is improved.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/track.sh:191
Finding
Unvalidated command-line input is interpolated into a signed API request<![CDATA[ ## Vulnerability Details **File Location**: `scripts/track.sh`, lines 191–202 **Vulnerability Type**: Improper input validation and unsafe JSON/form-data construction **Risk Level**: Medium ### Vulnerable Code ```bash PARAM="{\"com\":\"${CARRIER_CODE}\",\"num\":\"${TRACKING_NUM}\",\"resultv2\":\"4\",\"order\":\"desc\"}" # MD5 签名: param + key + customer -> 32位大写MD5 SIGN=$(calc_md5 "${PARAM}${API_KEY}${CUSTOMER}") # ---- 发起查询 ---- echo "📦 正在查询单号: ${TRACKING_NUM}" echo "" RESPONSE=$(curl -s -X POST "https://poll.kuaidi100.com/poll/query.do" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "customer=${CUSTOMER}&sign=${SIGN}&param=${PARAM}") ``` ### Technical Analysis `CARRIER_CODE` and `TRACKING_NUM` originate from command-line arguments and are inserted directly into a JSON string without JSON encoding or strict validation. Shell quoting prevents these values from being evaluated directly as shell commands, but it does not make them safe for the JSON or form-encoded data layers. Characters such as double quotes, backslashes, control characters, equals signs, and ampersands can break or modify the intended request structure. In particular: - Quotes and backslashes can produce malformed JSON or introduce additional JSON members. - Ampersands can split the raw `curl -d` body into additional form fields because the completed `param` value is not independently URL-encoded. - The resulting attacker-controlled request is signed using the legitimate API key and customer identifier before being submitted to Kuaidi100. The exact interpretation of duplicate or injected fields depends on the remote API parser. Therefore, arbitrary server-side field manipulation is not guaranteed, but malformed requests and signed request tampering are demonstrably possible. ### Attack Path 1. An attacker supplies a crafted tracking number or manually supplied carrier code through a package-tracking request. 2. The agent invokes `scripts/track.sh` with the ...[truncated 1223 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate tracking numbers against a conservative allowlist and length limit appropriate for supported carriers. For example, reject values containing quotes, backslashes, control characters, whitespace, ampersands, or equals signs. 2. Validate manually supplied carrier codes against an explicit list of supported Kuaidi100 carrier identifiers rather than accepting arbitrary strings. 3. Construct the JSON document with a JSON-aware utility: ```bash PARAM=$(jq -cn \ --arg com "$CARRIER_CODE" \ --arg num "$TRACKING_NUM" \ '{com: $com, num: $num, resultv2: "4", order: "desc"}') ``` 4. Have `curl` encode every form field independently: ```bash RESPONSE=$(curl --silent --show-error --fail-with-body \ -X POST "https://poll.kuaidi100.com/poll/query.do" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "customer=${CUSTOMER}" \ --data-urlencode "sign=${SIGN}" \ --data-urlencode "param=${PARAM}") ``` 5. Add maximum argument lengths to prevent oversized signed requests. 6. Add tests covering quotes, backslashes, ampersands, equals signs, control characters, and excessively long input. 7. Preserve the existing shell quoting; input validation and structured encoding should supplement it rather than replace it. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:27
Finding
Documentation recommends persistent plaintext storage of API credentials<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 27–31 **Vulnerability Type**: Plaintext sensitive credential storage **Risk Level**: Low ### Vulnerable Code ```bash For persistent config, add to `~/.bashrc` or `~/.zshrc`: ```bash echo 'export EXPRESS_TRACKER_KEY="your_key"' >> ~/.zshrc echo 'export EXPRESS_TRACKER_CUSTOMER="your_customer"' >> ~/.zshrc ``` ``` ### Technical Analysis The setup instructions recommend writing the Kuaidi100 API key and customer identifier directly into a shell startup file. These credentials then remain as plaintext on disk and are loaded into the environment of every subsequently started interactive shell. Shell initialization files may be exposed through insecure permissions, backups, workstation synchronization, troubleshooting bundles, accidental sharing, or unrelated processes operating under the same account. Environment inheritance also unnecessarily broadens the number of child processes that can access the credentials. The issue does not cause the Skill itself to transmit credentials to an unauthorized destination. The risk arises when users follow the documented persistence guidance. ### Attack Path 1. A user follows the persistent configuration instructions. 2. The API key and customer identifier are written in plaintext to `~/.zshrc` or a similar startup file. 3. A local process, backup recipient, diagnostic collector, or person with read access obtains the file or a copy of it. 4. The exposed credentials are extracted from the export statements. 5. The credentials are reused to submit unauthorized Kuaidi100 API requests until they are revoked, rotated, expire, or exhaust their available balance. ### Impact Assessment No operating-system privilege escalation is obtained. The exposed privileges are those associated with the affected Kuaidi100 API account. Potential effects include: - Unauthorized tracking queries. - Consumption of the account's daily quota or paid balance. - Temporary de ...[truncated 245 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not recommend storing API credentials directly in general-purpose shell startup files. 2. Prefer an operating-system credential manager, such as macOS Keychain, Secret Service, or another established secrets manager. 3. If file-based storage is required, use a dedicated configuration file with restrictive permissions: ```bash install -m 600 /dev/null "$HOME/.express-tracker.env" ``` 4. Load the dedicated file only immediately before invoking the tracking script rather than exporting the credentials into every interactive shell. 5. Document how users can revoke and rotate credentials if exposure is suspected. 6. Warn users not to commit credential files to version control, include them in support bundles, or synchronize them through untrusted backup services. 7. Where supported by the provider, use credentials with the smallest available quota and permissions necessary for tracking queries. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill instructs the agent to execute a shell script but does not declare any explicit tool scope or allowed-tools boundary. That makes the skill's executable capability less transparent and weakens policy enforcement, increasing the chance of unintended shell access or overbroad execution in environments that rely on manifest-declared permissions.

External Transmission

Medium
Category
Data Exfiltration
Content
Users must obtain their own Kuaidi100 API credentials:

1. **Register** at [Kuaidi100 Open Platform](https://api.kuaidi100.com/register/enterprise)
   - 注册企业版账号(个人也可注册)
   - Free tier: 100 queries/day after verification
Confidence
50% 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
Users must obtain their own Kuaidi100 API credentials:

1. **Register** at [Kuaidi100 Open Platform](https://api.kuaidi100.com/register/enterprise)
   - 注册企业版账号(个人也可注册)
   - Free tier: 100 queries/day after verification
Confidence
50% 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
Users must obtain their own Kuaidi100 API credentials:

1. **Register** at [Kuaidi100 Open Platform](https://api.kuaidi100.com/register/enterprise)
   - 注册企业版账号(个人也可注册)
   - Free tier: 100 queries/day after verification
Confidence
50% 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
echo "📦 正在查询单号: ${TRACKING_NUM}"
echo ""

RESPONSE=$(curl -s -X POST "https://poll.kuaidi100.com/poll/query.do" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "customer=${CUSTOMER}&sign=${SIGN}&param=${PARAM}")
Confidence
91% confidence
Finding
The script performs an external POST request to a third-party API containing shipment query data and account-related identifiers. In the context of an agent skill, this matters because user-supplied tracking numbers are exfiltrated off-host to an external service, which is a genuine privacy and trust-boundary concern even if it is core functionality.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script sends the tracking number and customer/account identifier to Kuaidi100 over the network without any user-facing privacy notice or consent prompt. Tracking numbers can reveal shipment activity and may be personal data in some contexts, so silent third-party transmission creates a real privacy and data-handling risk even though it is expected for the feature.

Missing User Warnings

Low
Confidence
92% confidence
Finding
The skill description does not clearly warn that user-supplied tracking numbers will be transmitted to Kuaidi100, a third-party service. Tracking numbers can be sensitive metadata that may reveal purchase activity, sender/recipient relationships, or location/status information, so lack of disclosure undermines informed consent and privacy expectations.

Natural-Language Policy Violations

Low
Confidence
98% confidence
Finding
Comments, usage instructions, and runtime prompts are written only in Chinese, and the script provides no language selection or opt-in. This can violate language/locale policy when a skill imposes a single language without user choice or explicit regional justification.

Static analysis

No suspicious patterns detected.