Back to skill

Security audit

今日油价查询 - 聚合数据

Security checks for vulnerabilities and agentic risk

Overview

This oil-price lookup skill matches its stated purpose, but it sends the required Juhe API key over unencrypted HTTP.

Review before installing or using with a real Juhe key. Prefer a version that uses HTTPS for the API request, avoid passing the key on the command line, keep any scripts/.env file private, and rotate the key if it has already been used through the documented HTTP endpoint.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/oil_price.py:55
Finding

API Credential Transmitted Through Unencrypted HTTP

Content
View full analysis
dict: """Query nationwide oil prices.""" params = {"key": api_key} url = f"{API_URL}?{urllib.parse.urlencode(params)}" try: with urllib.request.urlopen(url, timeout=15) as resp: data = json.loads(resp.read().decode("utf-8")) ``` The insecure endpoint is also explicitly documented at `SKILL.md:73-76`: ```text ### Direct API Call (No Script Required) GET http://apis.juhe.cn/gnyj/query?key=YOUR_KEY ``` ### Technical Analysis The script inserts the Juhe API key into a URL query parameter and transmits the resulting request to an unencrypted HTTP endpoint. HTTP provides neither transport confidentiality nor endpoint integrity. Because the credential appears in the request URL, any network intermediary capable of observing cleartext traffic can recover it. This may include an attacker on the same untrusted network, a compromised router, an ISP-level intermediary, or an HTTP inspection proxy. URLs may also be retained in proxy and server access logs. Even if the server redirects HTTP requests to HTTPS, the initial HTTP request already contains the API key in its request target. Following a subsequent HTTPS redirect therefore does not protect the credential from exposure during the first request. The lack of authenticated transport also allows an active man-in-the-middle attacker to modify the API response. The script trusts the returned JSON and displays the supplied oil-price data without independently authenticating its source. The network request is necessary for the Skill's declared oil-price lookup functionality, and transmission of an API credential to the declared provider is functionally ...[truncated 1674 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

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 · SKILL.md (reported line 27)May include surrounding context.

md
API Key 配置(任选其一,优先级从高到低):
    1. 环境变量: export JUHE_OIL_KEY=your_api_key
    2. 脚本同目录的 .env 文件: JUHE_OIL_KEY=your_api_key
    3. 直接传参: python oil_price.py --key your_api_key

免费申请 API Key: https://www.juhe.cn/docs/api/id/540

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 · SKILL.md (reported line 28)May include surrounding context.

md
API Key 配置(任选其一,优先级从高到低):
    1. 环境变量: export JUHE_OIL_KEY=your_api_key
    2. 脚本同目录的 .env 文件: JUHE_OIL_KEY=your_api_key
    3. 直接传参: python oil_price.py --key your_api_key

免费申请 API Key: https://www.juhe.cn/docs/api/id/540

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/oil_price.py (reported line 11)May include surrounding context.

python
API Key 配置(任选其一,优先级从高到低):
    1. 环境变量: export JUHE_OIL_KEY=your_api_key
    2. 脚本同目录的 .env 文件: JUHE_OIL_KEY=your_api_key
    3. 直接传参: python oil_price.py --key your_api_key

免费申请 API Key: https://www.juhe.cn/docs/api/id/540

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/oil_price.py (reported line 149)May include surrounding context.

python
API Key 配置(任选其一,优先级从高到低):
    1. 环境变量: export JUHE_OIL_KEY=your_api_key
    2. 脚本同目录的 .env 文件: JUHE_OIL_KEY=your_api_key
    3. 直接传参: python oil_price.py --key your_api_key

免费申请 API Key: https://www.juhe.cn/docs/api/id/540

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/oil_price.py (reported line 37)May include surrounding context.

python
if env_key:
        return env_key

    env_file = Path(__file__).parent / ".env"
    if env_file.exists():
        for line in env_file.read_text(encoding="utf-8").splitlines():
            line = line.strip()

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises code-capable behavior via metadata (python3, environment variable requirement, direct API usage) but does not declare an explicit tool scope or permission boundary. That makes the skill harder to sandbox and review, and can lead to overbroad runtime access to network, files, or environment data beyond what users expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill sends user query data to a third-party API service but does not clearly warn users in the main description or usage text that their request content may be transmitted externally. This creates a privacy and transparency risk, especially if users include sensitive location or contextual information in natural-language queries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The API endpoint is hardcoded as HTTP, so the API key is sent in cleartext over the network query string. An attacker on the same network path can intercept the key, replay requests, or abuse the account quota, and the returned data can also be tampered with in transit.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The description says the skill is used when users say phrases like “查一下油价”, “北京油价多少”, and “柴油价格等”, but it does not define boundaries or exclusions for when this skill should or should not activate. These phrases are common natural-language queries and the file provides no negative examples or narrower invocation constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

All user-facing documentation and messages in this file are written only in Chinese, with no indication that language selection is optional or that the tool is intentionally limited to a Chinese-speaking audience. The policy requires avoiding fixed language or locale constraints unless the user opts in or the limitation is clearly justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The manifest describes a simple oil-price lookup skill for end users, but the code additionally inspects process environment variables and local filesystem configuration to obtain credentials. While this is a common implementation pattern, it is not part of the stated purpose and introduces access to host configuration beyond the explicit user query behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.