{
  "skill_name": "amap",
  "skill_path": "/workspace/skills/clawhub-amap",
  "skill_directory": "/workspace/skills/clawhub-amap",
  "is_safe": false,
  "max_severity": "HIGH",
  "findings_count": 3,
  "findings": [
    {
      "id": "llm_finding_amap_0",
      "rule_id": "LLM_DATA_EXFILTRATION",
      "category": "data_exfiltration",
      "severity": "HIGH",
      "title": "Hardcoded API Key Exposure via Environment Variable",
      "description": "The skill requires users to set their Amap API key as an environment variable (AMAP_KEY) which is then directly embedded in curl commands. This creates multiple security risks: (1) API keys exposed in shell history, (2) Keys visible in process listings, (3) No validation or sanitization of the key, (4) Keys transmitted in URLs (query parameters) rather than headers, making them visible in logs and network traffic. The skill provides no guidance on secure key management, rotation, or access controls.",
      "file_path": "SKILL.md",
      "line_number": null,
      "snippet": "```bash\nexport AMAP_KEY=\"\u4f60\u7684Web\u670d\u52a1API Key\"\n```\nAll curl commands use: `key=$AMAP_KEY` in URL query parameters",
      "remediation": "1. Use header-based authentication instead of query parameters. 2. Implement key validation and sanitization. 3. Add warnings about key security and rotation. 4. Consider using a secure credential store instead of environment variables. 5. Document proper key scoping and access controls. 6. Warn users about shell history exposure.",
      "analyzer": "llm",
      "metadata": {
        "model": "claude-sonnet-4-5-20250929",
        "overall_assessment": "This Amap (\u9ad8\u5fb7\u5730\u56fe) skill presents MODERATE to HIGH security risks primarily related to API key management and input handling. The most critical issues are: (1) Hardcoded API key exposure through environment variables and URL query parameters, making keys visible in logs, shell history, and network traffic, (2) Command injection vulnerabilities due to unsanitized user input being directly interpolated into shell commands, and (3) Privacy concerns from sending user location data to third-party APIs without disclosure. The skill lacks basic security controls like input validation, URL encoding, and secure credential management. While functional for its intended purpose, it requires significant security hardening before production use. The missing optional metadata fields are informational only and do not constitute security vulnerabilities.",
        "primary_threats": [
          "Data Exfiltration/Exposure (API key leakage, third-party data sharing)",
          "Command Injection (unsanitized user input in shell commands)",
          "Privacy Violation (undisclosed location data transmission)",
          "Credential Management (insecure API key handling)"
        ],
        "aitech": "AITech-8.2",
        "aitech_name": "Data Exfiltration / Exposure",
        "aisubtech": "AISubtech-8.2.3",
        "aisubtech_name": "Data Exfiltration via Agent Tooling",
        "scanner_category": "SECURITY VIOLATION",
        "meta_validated": true,
        "meta_confidence": "HIGH",
        "meta_confidence_reason": "LLM analyzer correctly identified API key exposure risks. While environment variables are standard practice, URL parameter transmission is a legitimate security concern for sensitive credentials.",
        "meta_exploitability": "Low-Medium - Requires access to shell history, process listings, or server logs. Not directly exploitable remotely but increases attack surface.",
        "meta_impact": "Medium - Exposed API key could lead to unauthorized API usage, quota exhaustion, or service abuse. Impact limited to Amap API access, not system compromise."
      }
    },
    {
      "id": "llm_finding_amap_1",
      "rule_id": "LLM_COMMAND_INJECTION",
      "category": "command_injection",
      "severity": "MEDIUM",
      "title": "Command Injection Risk via Unsanitized User Input",
      "description": "All curl commands directly interpolate user-provided input (keywords, addresses, city names, coordinates) into URLs without any validation, sanitization, or encoding. An attacker could inject shell metacharacters or additional curl parameters through user input. For example, a malicious user could provide input like: '\u5317\u4eac; curl attacker.com' or use backticks/command substitution. While the instructions show placeholder syntax [\u5173\u952e\u8bcd], there's no guidance on proper input validation or URL encoding.",
      "file_path": "SKILL.md",
      "line_number": null,
      "snippet": "Examples of vulnerable patterns:\n```bash\ncurl \"https://restapi.amap.com/v3/place/text?key=$AMAP_KEY&keywords=[\u5173\u952e\u8bcd]&city=[\u57ce\u5e02]\"\ncurl \"https://restapi.amap.com/v3/geocode/geo?key=$AMAP_KEY&address=[\u5730\u5740]\"\n```\nNo input validation or URL encoding specified",
      "remediation": "1. Implement strict input validation for all user-provided parameters. 2. Use proper URL encoding for all query parameters. 3. Add explicit instructions to sanitize user input before substitution. 4. Consider using curl's --data-urlencode option. 5. Validate coordinate formats, city names, and keywords against expected patterns. 6. Add examples showing proper escaping techniques.",
      "analyzer": "llm",
      "metadata": {
        "model": "claude-sonnet-4-5-20250929",
        "overall_assessment": "This Amap (\u9ad8\u5fb7\u5730\u56fe) skill presents MODERATE to HIGH security risks primarily related to API key management and input handling. The most critical issues are: (1) Hardcoded API key exposure through environment variables and URL query parameters, making keys visible in logs, shell history, and network traffic, (2) Command injection vulnerabilities due to unsanitized user input being directly interpolated into shell commands, and (3) Privacy concerns from sending user location data to third-party APIs without disclosure. The skill lacks basic security controls like input validation, URL encoding, and secure credential management. While functional for its intended purpose, it requires significant security hardening before production use. The missing optional metadata fields are informational only and do not constitute security vulnerabilities.",
        "primary_threats": [
          "Data Exfiltration/Exposure (API key leakage, third-party data sharing)",
          "Command Injection (unsanitized user input in shell commands)",
          "Privacy Violation (undisclosed location data transmission)",
          "Credential Management (insecure API key handling)"
        ],
        "aitech": "AITech-9.1",
        "aitech_name": "Model or Agentic System Manipulation",
        "aisubtech": "AISubtech-9.1.4",
        "aisubtech_name": "Injection Attacks (SQL, Command Execution, XSS)",
        "scanner_category": "INJECTION ATTACK",
        "meta_validated": true,
        "meta_confidence": "HIGH",
        "meta_confidence_reason": "LLM analyzer identified clear command injection risk with concrete attack vectors. The skill provides raw shell command templates without any input sanitization guidance, creating direct exploitation path.",
        "meta_exploitability": "Medium - Requires user to provide malicious input, but no authentication or special privileges needed. Agent would execute the crafted command directly.",
        "meta_impact": "High - Arbitrary command execution on the system running the agent. Could lead to data theft, system compromise, or lateral movement."
      }
    },
    {
      "id": "llm_finding_amap_2",
      "rule_id": "LLM_DATA_EXFILTRATION",
      "category": "data_exfiltration",
      "severity": "MEDIUM",
      "title": "Potential Data Leakage via Third-Party API",
      "description": "The skill sends user queries (location searches, addresses, routes) to Amap's external API servers without any privacy warnings or data handling disclosure. Users may unknowingly expose sensitive location data, travel patterns, or personal addresses to a third-party service. There's no information about: (1) What data Amap collects, (2) How long it's retained, (3) Whether it's shared with other parties, (4) Compliance with privacy regulations (GDPR, CCPA). The skill also lacks any mechanism to anonymize or minimize data sent to the API.",
      "file_path": "SKILL.md",
      "line_number": null,
      "snippet": "All API calls send user data to restapi.amap.com:\n- Location searches with keywords\n- Specific addresses for geocoding\n- Route planning with origin/destination\n- Weather queries with city codes\nNo privacy warnings or data handling documentation provided",
      "remediation": "1. Add clear privacy warnings about data sent to third-party APIs. 2. Document Amap's data retention and privacy policies. 3. Provide guidance on minimizing sensitive data exposure. 4. Consider implementing local caching to reduce API calls. 5. Add opt-in consent mechanisms for sensitive queries. 6. Document compliance requirements for different jurisdictions.",
      "analyzer": "llm",
      "metadata": {
        "model": "claude-sonnet-4-5-20250929",
        "overall_assessment": "This Amap (\u9ad8\u5fb7\u5730\u56fe) skill presents MODERATE to HIGH security risks primarily related to API key management and input handling. The most critical issues are: (1) Hardcoded API key exposure through environment variables and URL query parameters, making keys visible in logs, shell history, and network traffic, (2) Command injection vulnerabilities due to unsanitized user input being directly interpolated into shell commands, and (3) Privacy concerns from sending user location data to third-party APIs without disclosure. The skill lacks basic security controls like input validation, URL encoding, and secure credential management. While functional for its intended purpose, it requires significant security hardening before production use. The missing optional metadata fields are informational only and do not constitute security vulnerabilities.",
        "primary_threats": [
          "Data Exfiltration/Exposure (API key leakage, third-party data sharing)",
          "Command Injection (unsanitized user input in shell commands)",
          "Privacy Violation (undisclosed location data transmission)",
          "Credential Management (insecure API key handling)"
        ],
        "aitech": "AITech-8.2",
        "aitech_name": "Data Exfiltration / Exposure",
        "aisubtech": "AISubtech-8.2.3",
        "aisubtech_name": "Data Exfiltration via Agent Tooling",
        "scanner_category": "SECURITY VIOLATION",
        "meta_validated": true,
        "meta_confidence": "MEDIUM",
        "meta_confidence_reason": "This is a legitimate privacy concern, but it's inherent to using any third-party API service. The skill's purpose is explicitly to use Amap API, so data transmission is expected. However, lack of disclosure is a valid issue.",
        "meta_exploitability": "N/A - This is a privacy/transparency issue, not a technical vulnerability",
        "meta_impact": "Low - Privacy concern rather than security vulnerability. Users should be informed, but data sharing is necessary for the skill's functionality."
      }
    }
  ],
  "scan_duration_seconds": 38.922324657440186,
  "duration_ms": 38922,
  "analyzers_used": [
    "static_analyzer",
    "behavioral_analyzer",
    "llm_analyzer",
    "trigger_analyzer",
    "meta_analyzer"
  ],
  "timestamp": "2026-02-05T19:18:29.702000"
}