china-law-search

Fail

Audited by Gen Agent Trust Hub on Aug 22, 2026

Risk Level: HIGHREMOTE_CODE_EXECUTIONCOMMAND_EXECUTIONCREDENTIALS_UNSAFEEXTERNAL_DOWNLOADS
Full Analysis
  • [REMOTE_CODE_EXECUTION]: The lib/gov_api.py script attempts to install external software at runtime using npm install -g @playwright/cli if the binary is missing, followed by execution of the installed package.
  • [COMMAND_EXECUTION]: The skill makes extensive use of subprocess.run to execute external commands including npm, playwright-cli, and pandoc. These calls are used for environment setup, network traffic interception, and document format conversion.
  • [DYNAMIC_EXECUTION]: In lib/gov_api.py, a multi-line Javascript snippet is constructed and passed to playwright-cli --raw run-code. This allows for the execution of arbitrary Javascript within a browser context to harvest session headers.
  • [CREDENTIALS_UNSAFE]: The scripts/law_search.py file reads sensitive data from a specific local configuration file at ~/.kiro/settings/mcp.json. It extracts fields like IMA_X_IMA_COOKIE and IMA_X_IMA_BKN and injects them into the process environment variables.
  • [UNVERIFIABLE_DEPENDENCIES]: The entry script scripts/law_search.py dynamically modifies sys.path to include a path pointing to a local GitHub repository (~/github/tencent-ima-copilot-mcp/src) and imports modules from it, which can lead to the execution of unverified code.
  • [EXTERNAL_DOWNLOADS]: The skill downloads legislative documents and regulation metadata from official government domains (flk.npc.gov.cn and gov.cn). While these sources are well-known, the process involves downloading HTML content that is subsequently passed to a document converter (pandoc).
  • [INDIRECT_PROMPT_INJECTION]: The skill ingests large amounts of untrusted text and HTML from external websites and presents it to the agent for processing, which could serve as a vector for indirect instructions.
  • Ingestion points: Regulation search results and full-text HTML content fetched in lib/flk_api.py and lib/gov_api.py.
  • Boundary markers: Not present; the content is interpolated directly into the context.
  • Capability inventory: The skill possesses file-writing capabilities and command execution via subprocess.
  • Sanitization: Only basic removal of highlight tags is performed; no robust sanitization of law content exists before it is processed by the AI.
Recommendations
  • HIGH: Downloads and executes remote code from: unknown (check file) - DO NOT USE without thorough review
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
Aug 22, 2026, 05:35 PM
Security Audit — agent-trust-hub — china-law-search