Back to skill

Security audit

Query paginated product trade data for a company — retrieve product names with trade counts,amounts, quantities, and associated HS codes for product-mix analysis. Enables paginatedproduct queries, company product trade details, import-export product breakdown and tradeproduct drill-down for comprehensive product portfolio understanding.

Security checks for vulnerabilities and agentic risk

Overview

This paid trade-data skill is mostly coherent, but it needs review because it can expose and persist API keys locally and includes account top-up helper actions.

Install only if you trust UpKuaJing and understand that API calls may cost money. Do not run commands that print `~/.upkuajing/.env`, do not paste API keys into chat or logs, confirm each paid query or top-up action separately, and keep any error report minimal and free of secrets or sensitive business data.

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 Is Printed to Standard Output

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/auth.py:61
Finding

API Key Is Persisted Without Explicitly Restrictive File Permissions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Third-Party Dependency Is Not Reproducibly or Integrity Pinned

Content
View full analysis
=0.23.0 ``` ```markdown 2. **Install dependencies**: `pip install -r requirements.txt` ``` ### Technical Analysis The requirement accepts any `httpx` release at or above version `0.23.0`. As a result, two installations performed at different times may resolve to different package versions and transitive dependency sets. No hashes are supplied to verify the identity of downloaded artifacts. The audit found no evidence that `httpx` is currently malicious or that the package name is typosquatted. The risk arises because future, compromised, or incompatible releases can be installed without a corresponding review of the Skill. Python package installation and subsequent imports execute code from the resolved dependency set. ### Attack Path 1. A user follows `SKILL.md` and runs `pip install -r requirements.txt`. 2. The package resolver selects the latest release satisfying `httpx>=0.23.0`, along with its then-current transitive dependencies. 3. If an allowed future release or distribution artifact is compromised, the unreviewed artifact is downloaded. 4. Package installation or later import executes code from the compromised dependency. 5. That code runs with the privileges of the user executing the Skill and may access files, environment variables, or network resources available to that account. This is a supply-chain exposure rather than evidence of an actively malicious dependency in the reviewed project. ### Impact Assessment A compromised dependency would execute with the operating-system privileges of the installing or invoking user. It could potentially access `UPKUAJING_API_KEY`, files readable by that user, API responses, and network resources available from the host. The practical l ...[truncated 218 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 (38)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a trade-data query tool, but it also performs remote version checks, reads local metadata, and maintains a version cache under the user's home directory. While less severe than credential or billing features, these unrelated network and file operations expand the skill's behavior beyond user expectations and create additional privacy and integrity risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a trade-data query tool, but it also performs remote version checks, reads local metadata, and maintains a version cache under the user's home directory. While less severe than credential or billing features, these unrelated network and file operations expand the skill's behavior beyond user expectations and create additional privacy and integrity risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a trade-data query tool, but it also performs remote version checks, reads local metadata, and maintains a version cache under the user's home directory. While less severe than credential or billing features, these unrelated network and file operations expand the skill's behavior beyond user expectations and create additional privacy and integrity risks.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a trade-data query tool, but it also performs remote version checks, reads local metadata, and maintains a version cache under the user's home directory. While less severe than credential or billing features, these unrelated network and file operations expand the skill's behavior beyond user expectations and create additional privacy and integrity risks.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The skill instructs reading the API key from ~/.upkuajing/.env and even shows a command to print the file contents. Exposing or encouraging direct reading of credential files is dangerous because it can leak secrets into tool output, logs, transcripts, or downstream systems.

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

The skill directs the agent to check for an API key in a local .env file and to guide users to place secrets there. This normalizes agent interaction with credential stores and increases the chance that secrets are read, overwritten, or mishandled by automation beyond the minimal need for authenticated execution.

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

The skill states that running auth.py --new_key will automatically save a new key to ~/.upkuajing/.env. Automated creation and storage of credentials in a local file increases exposure risk, especially when combined with file-read instructions elsewhere in the skill and unspecified permission boundaries.

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 a paginated product-trade query tool, but the file implements account provisioning, balance lookup, pricing, and recharge-order creation. That scope expansion is dangerous because it gives a data-query skill the ability to trigger billing-related side effects and manage credentials, increasing the blast radius if the skill is invoked unexpectedly or repurposed by an attacker.

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

Writing an issued API key to a plaintext .env file creates a persistent secret on disk that may be exposed through weak file permissions, backups, accidental commits, or local compromise. In the context of a skill that should only query product data, introducing local credential persistence broadens risk without clear necessity.

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

The code can create recharge/payment orders even though the skill's stated purpose is company product trade analysis. Billing side effects in an analytics skill can be abused to induce unwanted financial actions or socially engineer users into completing payments through returned payment URLs.

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

The manifest describes a skill for querying paginated company product trade data and returning product names, amounts, quantities, and HS codes. This file instead implements an exception-reporting client that sends runtime error details to a platform endpoint, which is a distinct operational purpose rather than an obvious implementation detail of product-list retrieval.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares capabilities that access environment variables, local files, and the network, but it does not define an explicit tool scope such as allowed-tools or permissions. That omission weakens containment and makes it harder to enforce least privilege, especially because the skill also reads credential files and performs authenticated remote actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document explicitly allows reporting raw request parameters, response data, and error context to a central error-reporting API, with only a brief note that sensitive fields will be auto-masked. That creates a real privacy and data-handling risk because error payloads often contain personal data, business-sensitive trade data, tokens, or stack traces, and the document does not require minimization, explicit redaction rules, or user/operator warning before transmission.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This file presents its purpose and behavior entirely in Chinese, and later CLI descriptions are also Chinese-only. That can violate language/locale policy when the skill forces a specific language without offering a choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script provisions new API keys and persists them locally, which is not necessary for a narrow read-only product-query skill. Creating and storing credentials inside the skill increases exposure to unauthorized key issuance, accidental leakage, and privilege creep if the local environment or logs are compromised.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
91% confidence
Finding

The explicit 'require_auth=False' weakens the security posture for a credential-provisioning endpoint by making account creation available without prior authentication. In a skill whose declared purpose is read-only trade analysis, embedding unauthenticated credential issuance is especially mismatched and increases the chance of misuse.

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

The explicit 'require_auth=False' weakens the security posture for a credential-provisioning endpoint by making account creation available without prior authentication. In a skill whose declared purpose is read-only trade analysis, embedding unauthenticated credential issuance is especially mismatched and increases the chance of misuse.

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 argument descriptions and error messages are all emitted in Chinese, with no mechanism for user opt-in or alternate locale selection. This is a natural-language policy concern because the skill imposes a fixed language on all users.

Content

No source excerpt is available for this finding.