Back to skill

Security audit

Query company customs trade statistics by HS code dimension — analyze HS code distribution,trade volume breakdown, and monthly trade trends. Provides trade HS code analysis, companyproduct category breakdown, import-export classification analysis and global trade codeintelligence for comprehensive trade pattern understanding.

Security checks for vulnerabilities and agentic risk

Overview

This skill performs the advertised customs-data query, but it also exposes and persists API credentials in risky ways and includes account/payment and hidden update-check behavior that users should review before installing.

Install only if you are comfortable with this skill using an UpKuaJing API key, making paid API calls after confirmation, and handling account/top-up flows. Do not let an agent print ~/.upkuajing/.env; store the key with restrictive permissions or a secret manager, review any payment URL before opening it, and only approve error reports after removing sensitive request or response details.

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

Error
Location
SKILL.md:37
Finding

API Key Exposure Through Documented Plaintext File Output

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/auth.py:24
Finding

API Key Stored Without Explicit Restrictive Permissions and Partially Disclosed

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unbounded and Unhashed Third-Party Dependency Installation

Content
View full analysis
=0.23.0 ``` `SKILL.md`: ```markdown 2. **Install dependencies**: `pip install -r requirements.txt` ``` ### Technical Analysis The dependency specification accepts every `httpx` version from 0.23.0 onward and provides no upper bound, lock file, or integrity hashes. Consequently, the exact package and transitive dependency versions installed may change over time. The installation command also relies on the caller's configured Python package index. A compromised package-index account, malicious mirror, altered index configuration, or compromised future compatible release could cause unreviewed code to enter the Skill's runtime environment. This is a supply-chain hardening weakness rather than evidence that the currently named `httpx` package is malicious. No typosquatted dependency or unsafe direct URL was found. ### Attack Path 1. The Agent follows `SKILL.md` and runs `pip install -r requirements.txt`. 2. `pip` queries the configured package index and resolves the newest version satisfying `httpx>=0.23.0`. 3. A compromised future release, malicious configured mirror, or otherwise unreviewed artifact is selected. 4. The package or one of its transitive dependencies is installed into the Python environment. 5. Malicious package code executes during installation or when the Skill imports and uses the dependency. 6. The package gains the privileges of the user running the Skill and may access files, environment variables, network resources, and the API credential available to that process. ### Impact Assessment If dependency resolution supplies a malicious artifact, arbitrary Python code can run with the operating-system privileges of the Agent or user performing installation and execution. T ...[truncated 378 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 (37)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill also performs remote version checks, reads local metadata, and writes a version cache in the user's home directory despite being presented as an analytics tool. Hidden update-check and local state behavior broadens the attack surface and introduces additional network and filesystem side effects that users may not expect from a read-mostly query skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill also performs remote version checks, reads local metadata, and writes a version cache in the user's home directory despite being presented as an analytics tool. Hidden update-check and local state behavior broadens the attack surface and introduces additional network and filesystem side effects that users may not expect from a read-mostly query skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill also performs remote version checks, reads local metadata, and writes a version cache in the user's home directory despite being presented as an analytics tool. Hidden update-check and local state behavior broadens the attack surface and introduces additional network and filesystem side effects that users may not expect from a read-mostly query skill.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The skill instructs access to a credential file in the user's home directory and shows a command to print its contents. In an agent setting, normalizing direct reads of .env files is dangerous because it can expose API secrets to logs, model context, or unintended outputs far beyond what is needed to verify configuration.

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

This workflow directs the agent to inspect a local .env file for API credentials and, if missing, to invoke a command that creates a new key and stores it automatically. Combining credential discovery, generation, and storage within a data-query skill materially increases privilege and creates risk of unauthorized secret handling or persistence on disk.

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

The skill tells the user to manually add an API key to a local .env file and supports automatic persistence of newly created keys there. Storing and handling secrets in plain-text home-directory files is risky in shared or agent-accessible environments, and the skill context makes this more dangerous because the same skill also uses file-read capabilities that could expose those credentials.

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 account administration functions such as API key issuance, balance lookup, pricing lookup, and recharge-order creation, which are unrelated to the declared HS-code trade-statistics purpose. In a skill context, this scope expansion is dangerous because it grants billing and credential-management capabilities that a data-analysis skill should not need, increasing the blast radius if the skill is invoked or repurposed unexpectedly.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

This finding points to handling of a .env file in a credential-management path. Reading and checking for existing API secrets in a local plaintext environment file is risky because such files are commonly exposed through weak permissions, backups, developer tooling, or accidental inclusion in archives, and this is especially concerning in a skill that should not manage credentials at all.

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

Opening and reading the .env file directly processes locally stored credentials in plaintext. This expands secret exposure surface and normalizes credential handling inside a non-admin skill, making accidental disclosure or misuse more likely if the environment file is accessible to other processes or users.

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

The script writes a newly issued API key into a .env file, persisting a sensitive credential in plaintext on disk. Plaintext secret storage materially increases the likelihood of credential compromise via filesystem access, backups, logs, sync tools, or accidental sharing, and is particularly unjustified given the skill's unrelated analytics purpose.

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

The script can create recharge/payment orders via /agent/auth/pay/url, a financial capability with no clear relationship to HS-code statistics analysis. Exposing payment initiation inside an analytics skill creates risk of unauthorized charges, social-engineering abuse, or covert monetization paths if the skill is triggered by an agent or user who expects read-only analysis behavior.

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'

# 日志开关

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
def load_env_file() -> Dict[str, str]:
    """
    从 ~/.upkuajing/.env 文件加载环境变量。

    Returns:
        环境变量字典

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
def load_env_file() -> Dict[str, str]:
    """
    从 ~/.upkuajing/.env 文件加载环境变量。

    Returns:
        环境变量字典

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
def load_env_file() -> Dict[str, str]:
    """
    从 ~/.upkuajing/.env 文件加载环境变量。

    Returns:
        环境变量字典

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
def load_env_file() -> Dict[str, str]:
    """
    从 ~/.upkuajing/.env 文件加载环境变量。

    Returns:
        环境变量字典

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes a skill for querying and analyzing company customs trade statistics by HS code, but this file implements exception telemetry that reports runtime errors to a platform endpoint. That behavior is operational/infrastructure reporting rather than trade-statistics analysis, so it materially exceeds the user-facing purpose described in the manifest.

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 behaviors that access environment variables, read/write files under the user's home directory, and make network calls, but it does not declare any explicit tool scope or permissions boundaries. In an agent environment, that lack of scoping increases the risk of over-privileged execution and makes it harder to enforce least privilege or review what the skill is allowed to do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The document explicitly instructs agents to send request parameters, response payloads, and error context to an error-reporting endpoint, with only a brief note that sensitive fields will be automatically masked. That creates a real privacy and data-handling risk because stack traces, request bodies, and response data commonly contain personal, commercial, or credential-adjacent information, and the document does not require minimization, user disclosure, or explicit restrictions on what may be uploaded.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file presents its purpose and CLI interaction entirely in Chinese, including the module docstring and later user-facing help/messages. Under the language/locale policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code can request a new API key and persist it locally to a .env file, which exceeds the expected behavior of an HS-code analytics skill. Credential minting and storage are sensitive operations; embedding them here increases the chance of silent credential proliferation, misuse by downstream components, and exposure of secrets through local file access or backups.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
84% confidence
Finding

The auth=False/require_auth=False setting represents an unsafe default for a sensitive operation: creating API credentials. Sensitive account operations should default to authenticated, least-privilege access; relaxing that control in an unrelated skill increases the chance of unauthorized provisioning and operational abuse.

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

The auth=False/require_auth=False setting represents an unsafe default for a sensitive operation: creating API credentials. Sensitive account operations should default to authenticated, least-privilege access; relaxing that control in an unrelated skill increases the chance of unauthorized provisioning and operational abuse.

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:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file’s natural-language documentation and user-facing messages are entirely in Chinese, beginning with the module description on L002 and continuing throughout prints/docstrings, with no indication that the skill is region-specific or that users can opt into another language. Under the policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains natural-language strings in Chinese in the module docstring, argument description, and error/help text, which effectively forces a specific language for users. Under the policy, locale or language constraints should either be optional for the user or clearly documented as justified for a region-specific tool.

Content

No source excerpt is available for this finding.