Back to skill

Security audit

国际实时金价 - 即刻数据

Security checks for vulnerabilities and agentic risk

Overview

This is a small gold-price lookup skill that sends a user-provided Jike API key to the documented Jike API, with one endpoint-override caveat users should handle carefully.

Install only if you intend to use jikeapi.cn and provide a Jike AppKey. Do not set JIKE_API_BASE_URL unless you deliberately want to use a trusted alternate endpoint, because the script will send the AppKey as a query parameter to that base URL. Keep any local .env file next to the script limited to the intended Jike key.

Vulnerability Patterns
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (1)

Tainted flow: 'url' from os.environ.get (line 130, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
"""
    url = f"{API_BASE_URL}{API_PATH_MAP[command]}?{urllib.parse.urlencode({**params, 'appkey': appkey})}"
    try:
        with urllib.request.urlopen(url, timeout=15) as response:
            return json.loads(response.read().decode("utf-8"))
    except urllib.error.HTTPError as exc:
        return {"code": exc.code, "message": f"接口请求失败: HTTP {exc.code}", "data": ""}
Confidence
89% confidence
Finding
The request URL is partially derived from the environment variable `JIKE_API_BASE_URL` and then used in `urllib.request.urlopen`, which can redirect requests to an attacker-controlled host. Because the AppKey is placed in the query string, overriding the base URL can exfiltrate credentials and make the script contact arbitrary internal or external endpoints; in an agent/runtime environment, environment variables are often easier to influence than source code, which increases risk.

Static analysis

No suspicious patterns detected.