Back to skill

Security audit

unisound-pre-existing-review

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its medical-claims review purpose, but it can send sensitive claim text and a bearer API key to a user-configurable network endpoint.

Install only if you trust the publisher and can control how it is run. Use the documented internal HTTPS API endpoint, avoid overriding --api-url in production, provide a narrowly scoped key, de-identify claim materials before submission, and store stdout or --output files as sensitive medical/claims data.

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:103
Finding
Arbitrary API Endpoint Can Receive Bearer Credentials and Sensitive Medical Records<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run.py:103-118`, with the user-controlled endpoint introduced at `scripts/run.py:235` and passed to the request at `scripts/run.py:285-293` **Vulnerability Type**: Unrestricted transmission of credentials and sensitive data to a configurable endpoint **Risk Level**: High ### Vulnerable Code ```python 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) body = json.loads(resp.read().decode("utf-8")) ``` The endpoint is directly configurable through a command-line argument: ```python p.add_argument("--api-url", default=DEFAULT_API_URL, help="OpenAI compatible endpoint URL") ``` The unvalidated value is subsequently passed into the network request: ```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` option accepts an arbitrary URL without validating its scheme or destination hostname. `call_llm()` then sends both the complete user prompt and the supplied API credential to that URL. The prompt is expected to contain insurance claims and medical-record information, potentially including sensitive health or identity data. No control enforces HTTPS, restricts requests to the documented internal API hostname, or prevents forwarding a production bearer credential to an untrusted destination. Consequently, anyone able to influence the command invocation—such as through an unsafe wrapper, automation configuration, copied command, or deployment setting—can redirect these sensitive values to an attacker-controlled server. The application documentation advises callers to anonymize ...[truncated 1866 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Restrict outbound requests to an explicit allowlist of approved HTTPS hosts, including the documented internal API hostname. 2. Reject plaintext `http://` endpoints whenever credentials or medical data are transmitted. 3. Parse the URL with `urllib.parse.urlsplit()` and validate the normalized scheme, hostname, and port before constructing the request. 4. Disable arbitrary endpoint overrides in production. If development overrides are required, place them behind an explicit unsafe-development flag and never forward production credentials in that mode. 5. Load the API key from a protected environment variable, secret manager, or restricted configuration file rather than a command-line argument, because command-line values may be exposed through process listings or job logs. 6. Use separate, narrowly scoped, short-lived credentials for development and production endpoints. 7. Add a confirmation or policy check before transmitting records outside the approved internal domain. 8. Add automated tests confirming that unapproved hosts, redirects to unapproved hosts, plaintext HTTP URLs, malformed URLs, and unexpected ports are rejected. 9. Review redirect behavior and either disable redirects or revalidate every redirect target before forwarding authorization headers. 10. Apply technical redaction or validation for expected sensitive identifiers instead of relying exclusively on callers to anonymize records. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill advertises no explicit tool/permission scope, yet its described implementation supports file read, optional file write via `--output`, and outbound network access to an internal medical model API. Without declared restrictions, a caller or runtime may grant broader capabilities than intended, increasing the chance of sensitive claims data being read from arbitrary paths, written to disk, or transmitted externally without clear policy enforcement.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The natural-language description, headings, inputs, and output template are all specified exclusively in Chinese, including fixed output labels such as “关系类型” and “是否报销”. This indicates a language constraint without any stated user choice or opt-in, which matches the locale/language policy violation criterion.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The default system prompt is entirely in Chinese and strictly constrains the output wording to fixed Chinese phrases such as `关系类型` and `是否报销`. This imposes a specific language/locale behavior without any user opt-in or explanation that the skill is intentionally limited to Chinese-language workflows.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The code sends raw user-provided medical record or claims text to an external HTTPS API via `urlopen` without any explicit consent flow, warning, redaction step, or policy gate. Because the skill processes highly sensitive health data, this creates a real confidentiality and compliance risk if operators or users do not understand that protected information leaves the local environment.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The skill writes the full question and model answer to stdout and optionally to an output file, which can include medical-record content and reimbursement conclusions. Persisting this data locally without warning, minimization, or access-control guidance increases the chance of accidental disclosure through shell history capture, logs, shared filesystems, or insecure file handling.

Static analysis

No suspicious patterns detected.