Back to skill

Security audit

Clinical Trial Chief Advisor / 临床试验总顾问

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious with high confidence because scanners report sensitive-data handling concerns, behavior beyond its stated scope, and broad local file and network capabilities; some analysis was incomplete.

Consider the suspicious verdict and the incomplete scan coverage before installing. In particular, review whether you are comfortable with the reported local retention and file writes, additional network destinations and outcome reporting, sibling-skill installation, and the reported confidentiality and local-service weaknesses; the findings do not establish malicious intent.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
.
Finding

Outcome reporting bypasses outbound authorization and resends unsanitized content

Content
View full analysis

Impact

Identifiers removed from the main request can be transmitted unchanged in the callback. Denied main requests can still disclose the original question. Locally produced answer content is also sent for remote logging.

T09 · Insecure Skill Coding Practices

Warning
Location
.
Finding

A local process can impersonate the orchestration service

Content
View full analysis

Impact

The impersonator can receive the raw question, conversation history and document context present in the payload, and substitute the returned answer. This can disclose data to a different local user without access to the victim's files.

T09 · Insecure Skill Coding Practices

Warning
Location
.
Finding

Loopback service exposes orchestration and shutdown without caller authentication

Content
View full analysis

Impact

A different local user can terminate the resident service or submit unauthorized cloud requests using the service's configured authorization. Shutdown interrupts active work, although later client invocations can restart the service.

Vulnerability Patterns
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (190)

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · adapters/install_sibling.py (reported line 87)May include surrounding context.

python
def _get_json(url: str) -> dict:
    req = urllib.request.Request(url, headers={"Accept": "application/json", "User-Agent": UA})
    with urllib.request.urlopen(req, timeout=TIMEOUT) as r:
        return json.loads(r.read().decode("utf-8", "replace"))

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · adapters/install_sibling.py (reported line 109)May include surrounding context.

python
def fetch_zip_bytes(slug: str) -> bytes:
    url = DOWNLOAD_URL + "?" + urllib.parse.urlencode({"slug": slug})
    req = urllib.request.Request(url, headers={"User-Agent": UA})
    with urllib.request.urlopen(req, timeout=TIMEOUT) as r:
        return r.read()

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · adapters/local_service_client.py (reported line 39)May include surrounding context.

python
def server_available() -> bool:
    try:
        with urllib.request.urlopen(SERVER_URL + "/health", timeout=1) as r:
            return r.status == 200
    except Exception:
        return False

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · adapters/local_service_client.py (reported line 47)May include surrounding context.

python
def server_version() -> dict:
    try:
        with urllib.request.urlopen(SERVER_URL + "/version", timeout=2) as r:
            return json.loads(r.read().decode("utf-8"))
    except Exception:
        return {}

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · adapters/local_service_client.py (reported line 81)May include surrounding context.

python
def shutdown_server():
    try:
        urllib.request.urlopen(SERVER_URL + "/shutdown", timeout=3)
    except Exception:
        pass

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · adapters/local_service_client.py (reported line 143)May include surrounding context.

python
data=data,
        headers={"Content-Type": "application/json"},
    )
    with urllib.request.urlopen(req, timeout=timeout) as r:
        return r.read().decode("utf-8")

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/cloud_brief.py (reported line 246)May include surrounding context.

python
"Authorization": "Bearer %s" % token,
                 "Accept": "application/json, text/event-stream"},
    )
    with urllib.request.urlopen(req, timeout=timeout) as resp:
        return _parse_body(resp.read().decode("utf-8", errors="replace"))

Tainted flow: 'card' from sys.stdin.read (line 986, user input) → subprocess.run (code execution)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

External input (network, user) flows to a code execution sink. This enables remote code execution or command injection.

Content

Scanner excerpt · scripts/refine_answer.py (reported line 709)May include surrounding context.

python
def _run_handle_need_tool(card: dict) -> dict:
    """在代码内机械执行 need_tool 执行卡(subprocess 调 handle_need_tool.py)。"""
    try:
        proc = subprocess.run(
            [sys.executable, str(ROOT / "scripts" / "handle_need_tool.py"),
             "--card", json.dumps(card, ensure_ascii=False)],
            capture_output=True, text=True, encoding="utf-8", errors="replace",

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

A cache that omits conversation context can return an answer generated for different clinical assumptions. The reported environment-enabled implementation also retains answers contrary to the manifest, although its code was not supplied.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied chunk implements a publication-maintenance utility, not the described clinical-advice workflow. Its urllib calls directly retrieve SkillHub search results and GitHub repository metadata, materially contradicting the explicit prohibition on local network retrieval and the declared controlled Coze-only communication. Its --fix path writes publication flags to the local registry, exceeding the read-only filesystem declaration. Reading ~/.skillhub/metadata.json additionally extends file access beyond the skill's own files. These are concrete undeclared capabilities, not merely supporting implementation details. The chunk does not show transmission of clinical questions or confidential attachments, so no such disclosure is inferred.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Deployment assistance can be a supporting implementation detail rather than a separate primary-purpose mismatch. However, this helper directly contradicts the explicit filesystem restriction: os.makedirs can create directories, and shutil.copyfile creates or overwrites .new files. The final move commands are only printed, not executed. No network access, clinical processing, or data exfiltration is demonstrated by this chunk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Sibling discovery and capability indexing can reasonably support the advisor's routing function, and the registry is not an answer cache or clinical knowledge base. However, the implemented filesystem behavior directly contradicts the explicit permission declaration: scan_all_skills() and _scan_skill() read sibling skill directories, while refresh() and main() write registry files. The --output argument permits writes beyond the default registry location. These are concrete resource-access mismatches, not merely omitted implementation details. This chunk provides no evidence of network retrieval, confidential-data transmission, or cloud sanitization behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The clinical domain is consistent, but the operational capabilities exceed the description and permissions. In execute_card(), the fallback execution path builds a CLI command, creates CARDS_ROOT/ with mkdir(), runs subprocess.run(), and reads resulting artifacts. Discovery and installation-command generation also inspect files outside this skill's own directory. Default handoff behavior does not remove these executable fallback capabilities. The code additionally invokes an optional cloud_brief helper and supports sibling workflows intended for data retrieval, although the supplied chunk does not itself establish which network requests those helpers or subprocesses perform. It does not automatically install skills, and its references to a local knowledge base are merely returned guidance, not evidence of an implemented local knowledge base.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Comment-response preparation could support the declared deliverable-drafting scope, so its subject matter alone is not a mismatch. However, append_replies explicitly removes an existing output path and writes a new DOCX archive containing modified comments. The CLI also accepts arbitrary input-document and reply-file paths without enforcing an own-files restriction. These are substantive filesystem capabilities inconsistent with the declared read-only permissions, not merely supporting implementation details. The supplied code contains no network transmission; the absence of cloud orchestration in this helper alone does not establish an additional mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Credential management is a reasonable supporting implementation detail for the declared cloud service. However, store_token() explicitly calls os.makedirs(), opens its destination in write mode, and attempts chmod(0600). It accepts a caller-supplied token_path without restricting the destination to the skill directory. This contradicts the declared read-only filesystem scope. The function is not automatically invoked in this chunk, but the write capability is explicitly implemented. This module itself performs no network requests, so its credentials and endpoint comments alone do not establish undeclared retrieval, additional outbound calls, or data exfiltration.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Localization and terminology lookup are reasonable supporting implementation details, not a materially different skill purpose. However, the implemented language-persistence functions perform filesystem mutations despite the explicit read-only declaration. These mutations occur when the functions are called, not automatically on import. The chunk contains no network requests, attachment uploads, or answer caching; translation dictionaries and the in-memory terminology cache do not establish an undeclared clinical knowledge base or answer cache.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared permissions specifically designate scripts/office_to_md.py for converting attachments over 5 MB. However, office_to_md() unconditionally calls check_upload(), which raises UploadRejected when the file exceeds MAX_FILE_BYTES (5 * 1024 * 1024). The CLI also invokes this check before conversion. Thus, the supplied converter cannot implement the advertised oversized-attachment fallback. Otherwise, local Office decoding is consistent with the declared supporting role. The absence of cloud orchestration in this helper is not itself a mismatch, and this chunk provides no evidence of network transmission or payload sanitization.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The service is a supporting implementation for the declared advisor, so its persistence, module preloading, and loopback endpoints do not independently constitute a mismatch. However, _redirect_stderr_to_log explicitly modifies the filesystem, contradicting the declared read-only permission. The supplied chunk delegates clinical processing to imported code; it does not establish whether cloud payload sanitization, attachment handling, or caching guarantees are satisfied.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Downloading and installing executable skill packages expands trust beyond the declared Coze service and read-only operation. If reachable through agent workflows, replacement of existing skills can introduce persistent untrusted instructions or code; normal entry-point reachability is not established here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Enabling full-answer caching violates the unconditional no-local-cache assurance and may persist confidential clinical content. A configurable data root is not inherently exploitable, but it increases the importance of validating storage permissions and retention.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Environment-enabled answer retention violates the unconditional no-local-cache promise when activated. Approximate deduplication can also reuse answers across materially different clinical questions unless context and identity boundaries are enforced.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Executing supplied R code grants capabilities far beyond the declared read-only advisor, including potential file access and network activity. Exploitability depends on whether untrusted user or cloud content can reach this utility, which is not established by the supplied source.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Local answer retrieval contradicts both cloud-only retention and the assurance that every question is forwarded. This can retain confidential content unexpectedly and bypass current cloud checks or context handling.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Persistent document-content storage contradicts the no-local-knowledge-retention assurance and can retain confidential protocols or subject information. A raw-upload fallback also undermines reliance on local conversion as a preprocessing boundary, though conversion alone is not sanitization.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Reporting original questions, final answers, and tool details creates an additional sensitive-content egress path beyond the declared consultation request. Local retention is also contradictory, but stitch and default client handoffs are disclosed and should not be treated as inherently hidden execution.

Content

No source excerpt is available for this finding.