Back to skill

Security audit

Query HS code detail information for analysis reports — retrieve Chinese and English descriptions for a given HS (Harmonized System) code from customs data. Provides comprehensive product classification details to help trade professionals, analysts and import-export practitioners understand what products a specific HS code represents. Essential for tariff code lookup, product classification verification, customs code interpretation and trade data analysis preparation across global customs trade data.

Security checks for vulnerabilities and agentic risk

Overview

The skill provides the advertised HS-code lookup, but its credential handling and automatic support behavior need review before installation.

Install only if you are comfortable with a paid external API skill that stores an UpKuaJing API key locally. Do not let the agent print ~/.upkuajing/.env into chat or logs, confirm any fee-incurring or payment-related action, and avoid sending raw request or response data in error reports unless it has been sanitized.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:37
Finding

API Key Disclosure Through Credential File Display

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/auth.py:61
Finding

API Key File Is Created Without Enforced Restrictive Permissions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned and Unverified Third-Party Dependency

Content
View full analysis
=0.23.0 ``` Related installation instruction in `SKILL.md`, lines 19-20: ```markdown 1. **Check Python**: `python --version` 2. **Install dependencies**: `pip install -r requirements.txt` ``` ### Technical Analysis The dependency specification accepts every future `httpx` release at or above version `0.23.0`. It does not identify a reviewed version, impose an upper compatibility bound, or provide package hashes. As a result, installation is not reproducible: the code installed by the documented command can change over time without any modification to this Skill. A future compromised, malicious, or incompatible package release could alter request handling or execute package-controlled code during installation or import. No evidence of dependency confusion, typosquatting, an unsafe alternate package index, or a currently malicious `httpx` release was found. The risk arises from mutable dependency resolution and missing integrity controls rather than from a confirmed malicious package. ### Attack Path 1. A user follows the documented setup command, `pip install -r requirements.txt`. 2. The package resolver selects the newest release satisfying `httpx>=0.23.0`. 3. If a future selected release or one of its transitive dependencies is compromised, unintended code is installed. 4. Package code executes during import or normal Skill operation. 5. Because this Skill handles an API key and performs network requests, compromised dependency code could potentially access process credentials, modify requests, or transmit data with the privileges of the Python process. ### Impact Assessment Potential impact is bounded by the privileges of the user running `pip` and the Skill. In a compromised-release scenario, dependency code could read f ...[truncated 377 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Version checking, reading SKILL.md metadata, writing a local version cache, and printing upgrade notices are not necessary for an HS-code description lookup and expand both local file access and network behavior. This increases complexity and can undermine the principle of least privilege for a simple informational skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Version checking, reading SKILL.md metadata, writing a local version cache, and printing upgrade notices are not necessary for an HS-code description lookup and expand both local file access and network behavior. This increases complexity and can undermine the principle of least privilege for a simple informational skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Version checking, reading SKILL.md metadata, writing a local version cache, and printing upgrade notices are not necessary for an HS-code description lookup and expand both local file access and network behavior. This increases complexity and can undermine the principle of least privilege for a simple informational skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Version checking, reading SKILL.md metadata, writing a local version cache, and printing upgrade notices are not necessary for an HS-code description lookup and expand both local file access and network behavior. This increases complexity and can undermine the principle of least privilege for a simple informational skill.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The skill instructs reading the full ~/.upkuajing/.env file, which can expose API keys and potentially other secrets stored in that file. For a lookup skill, direct credential-file access is especially risky because it normalizes secret handling in a user-facing workflow and could leak credentials through logs, prompts, or downstream tooling.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

This skill requires an API key. The API key is stored in the ~/.upkuajing/.env file:

bash
cat ~/.upkuajing/.env

Example file content:

text

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The skill directs the agent to check and potentially populate ~/.upkuajing/.env with an API key, including automatic key creation and storage. This combines credential discovery, issuance, and local persistence in a skill that users may expect to be read-only, raising the risk of secret mishandling and unauthorized account actions.

Content

Scanner excerpt · SKILL.md (reported line 48)May include surrounding context.

md
### **API Key Not Set**
First check if the `~/.upkuajing/.env` file has UPKUAJING_API_KEY;
If UPKUAJING_API_KEY is not set, prompt the user to choose:
1. User has one: User provides it (manually add to ~/.upkuajing/.env file)
2. User doesn't have one: You can apply using the interface (`auth.py --new_key`), the new key will be automatically saved to ~/.upkuajing/.env
Wait for user selection;

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

Automatic saving of a newly created API key into ~/.upkuajing/.env creates a persistent local secret-handling path that is broader than necessary for the stated skill purpose. Persistent credential writes can be abused by overprivileged skills, expose secrets to other local processes, or leave sensitive material in insecure file permissions or backups.

Content

Scanner excerpt · SKILL.md (reported line 49)May include surrounding context.

md
First check if the `~/.upkuajing/.env` file has UPKUAJING_API_KEY;
If UPKUAJING_API_KEY is not set, prompt the user to choose:
1. User has one: User provides it (manually add to ~/.upkuajing/.env file)
2. User doesn't have one: You can apply using the interface (`auth.py --new_key`), the new key will be automatically saved to ~/.upkuajing/.env
Wait for user selection;

### **Account Top-up**

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file implements authentication, account management, recharge, and pricing features that are outside the declared purpose of an HS code description lookup skill. In a least-privilege agent ecosystem, unjustified expansion into account and billing operations increases attack surface and creates opportunities for unauthorized account manipulation or unexpected charges.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code can request a new API key and persist it locally, which is unrelated to a customs lookup function and materially increases credential risk. A skill that can mint and store credentials may be abused to create unauthorized access paths or silently alter the execution environment for later use.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/auth.py (reported line 18)May include surrounding context.

python
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/auth.py (reported line 78)May include surrounding context.

python
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/common.py (reported line 63)May include surrounding context.

python
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/common.py (reported line 85)May include surrounding context.

python
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/common.py (reported line 90)May include surrounding context.

python
"""
    申请新的 API 密钥。
    """
    # 检查是否已存在 .env 文件和 API key
    env_file = UPKUAJING_ENV_FILE

    if env_file.exists():

Credential Access

High
Category
Privilege Escalation
Confidence
78% confidence
Finding

The code reads the entire .env file content to inspect existing credentials, which means the skill handles plaintext secrets directly. In the context of an unrelated HS code lookup skill, direct credential-file access is unjustified and increases the chance of accidental disclosure, logging, or misuse by adjacent functionality.

Content

Scanner excerpt · scripts/auth.py (reported line 22)May include surrounding context.

python
env_file = UPKUAJING_ENV_FILE

    if env_file.exists():
        # 读取现有的 .env 文件
        try:
            with open(env_file, 'r', encoding='utf-8') as f:
                content = f.read()

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The script writes a newly issued API key to a local .env file in plaintext, creating a persistent secret on disk without visible controls for encryption, rotation, or permission hardening. For a skill whose stated purpose is simple HS code lookup, storing credentials this way is excessive and raises the risk of credential compromise from local file access or later leakage.

Content

Scanner excerpt · scripts/auth.py (reported line 71)May include surrounding context.

python
"envFilePath": str(env_file)
        }

    # 保存到 .env 文件
    try:
        with open(env_file, 'w', encoding='utf-8') as f:
            f.write(f"{API_KEY_ENV}={api_key}\n")

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The CLI exposes account info, recharge-order creation, and pricing operations that are not justified by the stated customs-code lookup purpose. This mismatch is dangerous because users or calling agents may invoke sensitive financial/account actions under the guise of a benign lookup capability.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/common.py (reported line 19)May include surrounding context.

python
API_BASE_URL = "https://openapi.upkuajing.com"
API_KEY_ENV = "UPKUAJING_API_KEY"
UPKUAJING_DIR = Path.home() / '.upkuajing'
UPKUAJING_ENV_FILE = UPKUAJING_DIR / '.env'
UPKUAJING_LOGS_DIR = UPKUAJING_DIR / 'logs'

# 日志开关

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill manifest says the skill queries HS code details and returns Chinese/English descriptions for a given HS code. In contrast, this code validates error-report parameters and sends them to '/agent/skill/error/report', which is operational telemetry behavior unrelated to customs code detail retrieval.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares no explicit tool scope or permission boundaries even though its documented behavior includes environment access, local file reads/writes, and networked API operations. This creates an overprivileged execution model where a seemingly simple HS-code lookup skill can access credentials and perform side-effecting actions beyond user expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation explicitly permits sending request parameters, response payloads, and exception context to an error-reporting endpoint. Even though it states sensitive fields will be auto-masked, it does not define masking guarantees or require user/operator minimization, so agents may transmit personal data, credentials, business data, or model inputs/outputs during failure handling. In a customs/HS-code workflow, request and response content can include product, shipment, or customer-related information, making unintended disclosure to the platform a realistic privacy and compliance risk.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
87% confidence
Finding

The explicit require_auth=False parameter codifies an insecure default for a sensitive operation that creates API credentials. Even if the backend intends to allow self-service signup, embedding that behavior in an unrelated skill makes accidental or unauthorized provisioning easier and weakens separation of duties.

Content

Scanner excerpt · scripts/auth.py (reported line 41)May include surrounding context.

python
pass  # 如果读取失败,继续执行

    # 不需要认证申请新密钥
    response = make_request('/agent/auth/create', {}, require_auth=False)

    # 检查是否申请成功
    if response.get('code') != 0:

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
87% confidence
Finding

The explicit require_auth=False parameter codifies an insecure default for a sensitive operation that creates API credentials. Even if the backend intends to allow self-service signup, embedding that behavior in an unrelated skill makes accidental or unauthorized provisioning easier and weakens separation of duties.

Content

Scanner excerpt · scripts/auth.py (reported line 41)May include surrounding context.

python
pass  # 如果读取失败,继续执行

    # 不需要认证申请新密钥
    response = make_request('/agent/auth/create', {}, require_auth=False)

    # 检查是否申请成功
    if response.get('code') != 0:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a narrowly scoped skill for retrieving Chinese and English descriptions for a given HS code, but this file defines a task-data directory and later supports saving metadata and result files under that directory. Persistent task management and local result storage are broader behaviors than a straightforward detail lookup utility and are not implied by the manifest text.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The task management section generates task IDs, creates per-task directories, stores metadata, and appends result data. That is a reusable batch/job-processing capability rather than a purpose-specific implementation detail for returning Chinese and English descriptions of one HS code.

Content

No source excerpt is available for this finding.