Back to skill

Security audit

Query paginated HS code trade data for a company — retrieve HS codes with trade counts, amounts,and percentages for supplier product-mix analysis. Enables paginated HS code queries, companyproduct category details, trade classification breakdowns and HS code drill-down acrossglobal customs trade data covering 220+ countries.

Security checks for vulnerabilities and agentic risk

Overview

The skill performs its advertised paid HS-code lookup, but it also handles credentials, account/payment actions, diagnostics, and an automatic version check in ways users should review carefully.

Review before installing. Use this only if you are comfortable with a paid UpKuaJing integration that stores an API key on disk and can create recharge/payment URLs. Prefer setting UPKUAJING_API_KEY through a secure environment mechanism, avoid printing ~/.upkuajing/.env, and confirm any fee-incurring query or error report only after checking what data will be sent.

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

Credential File Contents May Be Exposed to the Agent and Command Output

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/auth.py:71
Finding

Plaintext API Key File Is Created Without Enforced Owner-Only Permissions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded Dependency Version Permits Unaudited Future Releases

Content
View full analysis
=0.23.0 ``` The dependency is installed through the following documented setup flow: ```markdown 1. **Check Python**: `python --version` 2. **Install dependencies**: `pip install -r requirements.txt` ``` ### Technical Analysis The lower-bound-only constraint allows any current or future `httpx` release satisfying `>=0.23.0`, together with whatever transitive dependency versions the resolver selects. Consequently, installations are not reproducible and may execute code that was not part of this audit. No evidence was found that `httpx` is malicious, typosquatted, or obtained from an untrusted package source. The risk comes from allowing unaudited future versions and unconstrained transitive dependencies. Package installation can execute build backends and other packaging code with the privileges of the user running `pip`. ### Attack Path 1. The user follows `SKILL.md` and runs `pip install -r requirements.txt`. 2. The package resolver selects the latest release satisfying `httpx>=0.23.0` and resolves its transitive dependencies. 3. A future compromised, malicious, or unexpectedly incompatible release satisfies the constraint. 4. Installation or import executes code from that release in the user's Python environment. 5. The compromised dependency gains the same local privileges as the process, potentially including access to the API-key environment variable and user-readable files. This path depends on a future supply-chain compromise or unsafe release; no such compromise was confirmed in the audited package. ### Impact Assessment If the dependency supply chain were compromised, malicious installation or runtime code would execute with the invoking user's privileges. It could access the API key, read or alter use ...[truncated 254 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 (39)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill reportedly performs remote version checks, reads local metadata, writes a cache file under ~/.upkuajing, and emits upgrade notices—behavior unrelated to the stated HS-code query function. Hidden update or telemetry logic broadens the attack surface and introduces unexpected local persistence and outbound communication for a business-data lookup skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill reportedly performs remote version checks, reads local metadata, writes a cache file under ~/.upkuajing, and emits upgrade notices—behavior unrelated to the stated HS-code query function. Hidden update or telemetry logic broadens the attack surface and introduces unexpected local persistence and outbound communication for a business-data lookup skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill reportedly performs remote version checks, reads local metadata, writes a cache file under ~/.upkuajing, and emits upgrade notices—behavior unrelated to the stated HS-code query function. Hidden update or telemetry logic broadens the attack surface and introduces unexpected local persistence and outbound communication for a business-data lookup skill.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

The instruction to run cat ~/.upkuajing/.env is a direct request to access a sensitive credential store. Because .env files commonly contain live API secrets, this behavior creates an obvious path for credential exposure, misuse of the user's paid account, and possible compromise of related services if the key is reused or insufficiently scoped.

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 instructs checking and manually modifying ~/.upkuajing/.env for API-key handling, and states that a newly created key will be automatically saved there. This encourages interaction with a local secret file and normalized persistence of credentials without clear safeguards, which increases the chance of accidental exposure or insecure storage practices.

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

Directing the agent to inspect whether ~/.upkuajing/.env contains UPKUAJING_API_KEY still constitutes access to a secret-bearing file, even if the goal is only presence checking. In practice, such instructions often result in reading or echoing the file content, which is especially risky in an LLM-mediated environment where outputs may be logged or surfaced unintentionally.

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 skill is described as an HS-code trade-data query tool, but the file adds separate authentication lifecycle and billing capabilities such as API key provisioning, account lookup, recharge creation, and pricing retrieval. That scope expansion is dangerous because it gives the skill access to credential and payment-adjacent operations unrelated to the stated user task, increasing the attack surface and enabling abuse if invoked unexpectedly.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code can request a new platform API key and persist it locally, which is an unjustified sensitive capability for a company HS-code listing skill. Provisioning credentials inside a data-retrieval skill creates a path for unauthorized credential creation, persistence, and later misuse, especially because the skill context does not require users to manage platform identity or secrets.

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 22)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
95% confidence
Finding

This line writes the API key into a local .env file in plaintext, creating durable credential exposure on disk. In the context of a skill that should only query HS-code data, credential persistence is especially risky because it enables later unauthorized use of platform access outside the user’s immediate action.

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")

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'

# 日志开关

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file adds outbound exception reporting to a platform endpoint, which is outside the skill's declared purpose of HS code list retrieval. That hidden or undocumented behavior increases supply-chain risk because runtime context may be exfiltrated during failures, and users or integrators would not reasonably expect network transmission of diagnostic data from this skill.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises executable behavior that can access environment variables, read and write local files, and make network requests, but it declares no explicit tool scope or permission boundary. That makes the skill harder to sandbox and review, and increases the risk that a caller or agent may invoke capabilities beyond what users expect from a simple HS-code query tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs reading a local .env file containing the API key via a shell command, without any warning against exposing the secret in chat output or logs. In an agent setting, this can lead to direct credential disclosure to the model, the user, or telemetry systems, turning a normal setup step into a secret-exfiltration risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The API documentation explicitly encourages sending raw request parameters, response payloads, and exception context to a centralized error-reporting endpoint. Although it notes that sensitive fields will be automatically redacted, it does not define the redaction scope or require callers to minimize data before submission, creating a realistic risk of over-collection and leakage of confidential business data, personal data, tokens, or stack traces.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
90% confidence
Finding

Using require_auth=False for /agent/auth/create establishes an unsafe default in this skill because a user invoking a data-query tool can reach credential-provisioning behavior without prior authentication. Given the mismatch between declared skill purpose and implemented capability, this increases risk and is more dangerous than it would be in a dedicated account-registration component.

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
90% confidence
Finding

Using require_auth=False for /agent/auth/create establishes an unsafe default in this skill because a user invoking a data-query tool can reach credential-provisioning behavior without prior authentication. Given the mismatch between declared skill purpose and implemented capability, this increases risk and is more dangerous than it would be in a dedicated account-registration component.

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:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code writes a newly issued API key directly to a local .env file on disk without a prior warning, opt-in, permission hardening, or use of a secure secret store. Storing credentials in plaintext files increases exposure to local compromise, accidental inclusion in backups or source control, and unauthorized reuse by other processes or users on the host.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exposes account balance, recharge-order creation, and pricing-management discovery that are unrelated to retrieving HS-code trade data. These functions reveal financial/account metadata and can trigger payment workflow actions, broadening the skill beyond its declared purpose and creating unnecessary risk if the capability is abused or called unintentionally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file’s human-facing natural language is exclusively Chinese, starting with the module description, and the code later emits only Chinese user-facing messages. Under the stated policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.