Back to skill

Security audit

unisound-chronic-injury

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for insurance medical review, but it can send sensitive claim text and a bearer key to any operator-supplied API URL.

Review this carefully before installing in sensitive environments. Only use it with a trusted, intended HTTPS API endpoint, protect and scope the appkey, de-identify claim materials before use, and avoid --output unless you are comfortable storing the question, metadata, and model answer on disk.

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/run.py:87
Finding
Configurable API Endpoint Can Expose the Bearer Credential and Sensitive Medical Data<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run.py:87-102`, `scripts/run.py:233`, and `scripts/run.py:278-286` **Vulnerability Type**: Unrestricted credential-bearing network destination **Risk Level**: High ### Vulnerable Code ```python def call_llm( *, api_url: str, model: str, appkey: str, system_prompt: str, user_prompt: str, temperature: float, timeout: int, ) -> str: payload = { "model": model, "temperature": temperature, "messages": [ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}, ], } try: req = Request( api_url, data=json.dumps(payload, ensure_ascii=False).encode("utf-8"), headers={ "Content-Type": "application/json", "Authorization": f"Bearer {appkey}", }, ) resp = urlopen(req, timeout=timeout) ``` The destination is directly configurable through a command-line argument: ```python p.add_argument("--api-url", default=DEFAULT_API_URL, help="OpenAI 兼容接口地址") ``` The caller-supplied destination and credential are then passed to the request function: ```python out["answer"] = call_llm( api_url=args.api_url, model=args.model, appkey=args.appkey, system_prompt=args.system_prompt, user_prompt=user_prompt, temperature=float(args.temperature), timeout=int(args.timeout), ) ``` ### Technical Analysis The `--api-url` argument accepts an unrestricted URL. `call_llm()` sends both the bearer credential and the complete user prompt to that destination without validating the URL scheme or hostname. There is no enforcement that the destination: - Uses HTTPS. - Matches the documented internal medical-model hostname. - Belongs to an approved endpoint allowlist. - Remains on the approved origin after an HTTP redirect. Consequently, anyone able to influence the command-line ar ...[truncated 2204 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `--api-url` from production-facing invocations if endpoint customization is unnecessary. 2. Enforce an allowlist containing the exact approved HTTPS origin, including the expected hostname and port. 3. Reject every non-HTTPS URL before constructing the request. 4. Normalize and parse URLs with `urllib.parse.urlsplit()` before validation; do not rely on string-prefix checks. 5. Reject URLs containing unexpected user-information, ports, schemes, or hostnames. 6. Disable redirects or validate every redirect target before forwarding the request. Never forward the `Authorization` header across origins. 7. Separate endpoint selection from untrusted command-line input by using an administrator-controlled configuration. 8. Use short-lived, narrowly scoped credentials and rotate any key suspected of having been transmitted to an unauthorized endpoint. 9. Add automated tests confirming rejection of HTTP URLs, unapproved domains, deceptive subdomains, embedded credentials, alternate ports, and cross-origin redirects. 10. Continue requiring upstream de-identification, and consider adding local validation or warnings for common personal identifiers before transmitting prompts. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The manifest description and the entire user-facing documentation are written only in Chinese, and the output schema examples require Chinese labels such as “伤情类别” and “判断依据”. This indicates a fixed language/locale behavior without any opt-in, alternative language support, or justification that the skill is restricted to a Chinese-only regulatory or regional context.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script sends full user-provided medical/insurance claim content to an external HTTPS API via `urlopen` without any built-in consent prompt, masking, or warning that sensitive health data is leaving the local environment. In this skill context, the input commonly contains imaging reports and injury details, so the transmitted data is likely regulated or highly sensitive PHI/PII, making undisclosed remote processing materially risky.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The script writes model outputs and echoed question content to an arbitrary path with `write_text`/file open, without warning that the file may persist sensitive medical and claim information or overwrite an existing file. Because outputs include `question`, `meta`, and `answer`, the resulting files can store substantial PHI/PII on disk and expose it to other local users, backups, or accidental disclosure.

Static analysis

No suspicious patterns detected.