Back to skill

Security audit

건강보험심사평가원 병원 검색

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Korean hospital lookup skill, but crafted hospital search inputs can run local Python code on the user’s machine.

Review before installing. Use only if you trust the publisher and can patch the unsafe python3 -c argument handling first; otherwise a maliciously crafted hospital name or type could execute code with your user permissions. If used, store the API key with restrictive permissions and expect queries plus the service key to be sent to data.go.kr.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/hospital_search.sh:54
Finding

Arbitrary Python Code Execution Through the Hospital Name Argument

Content
View full analysis
Remediation
View remediation
` so HTTP and transport errors fail predictably. 5. Add regression tests containing quotes, backslashes, newlines, shell metacharacters, and non-ASCII names to confirm that all values remain data rather than executable code. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/hospital.sh:64
Finding

Arbitrary Python Code Execution Through the Hospital Type Argument

Content
View full analysis
= 0: items.append(item_dict) ``` This Python code is part of a shell double-quoted argument passed to `python3 -c`, so `$HOSP_TYPE` is expanded by the shell before Python parses the program. ### Technical Analysis The second positional argument is stored in `HOSP_TYPE` and interpolated twice into single-quoted Python string literals. The single quotes only delimit strings in the generated Python program; they do not safely encode the argument. An attacker can include a single quote and subsequent Python syntax in the hospital-type value. When shell expansion constructs the `python3 -c` argument, the attacker-controlled syntax becomes part of the Python source and is executed by the interpreter. The use of `set -euo pipefail` does not prevent this issue. It controls shell error handling but does not provide safe encoding for values embedded in another programming language. ### Attack Path 1. An attacker supplies or influences the hospital-type criterion. 2. The Skill invokes `hospital.sh`, placing the crafted criterion in the second positional argument. 3. Line 14 stores the input in `HOSP_TYPE` without constraining it to an allowlist. 4. Shell expansion inserts the value into both Python expressions on line 64. 5. Crafted input closes the expected Python string and introduces executable Python syntax. 6. The Python interpreter runs the injected code with the privileges and environment of the Skill pro ...[truncated 931 chars]
Remediation
View remediation
` for bounded and observable network failures. 5. Add tests using quotes, newlines, backslashes, Python operators, and non-ASCII values. 6. Keep the API-key file permission-restricted, for example with mode `0600`, to reduce impact if another local account is compromised. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (14)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/hospital.sh (reported line 26)May include surrounding context.

sh
echo "시도: $SIDO_CD | 종별: $HOSP_TYPE" >&2

# 요청 실행
RESPONSE=$(curl -s -G "$URL" \
    --data-urlencode "serviceKey=$API_KEY" \
    --data "sidoCd=$SIDO_CD" \
    --data "pageNo=$PAGE_NO" \

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/hospital_search.sh (reported line 55)May include surrounding context.

sh
PARAMS="${PARAMS}&yadmNm=${ENCODED_NAME}"
fi

RESPONSE=$(curl -s "${URL}?${PARAMS}")

echo "$RESPONSE" | python3 -c "
import sys, json

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares connectors, shell scripts, and external API usage but does not define an explicit tool/permission boundary such as allowed tools or scoped permissions. In an agent environment, this can let the runtime invoke broader shell or network capabilities than users or reviewers expect, increasing the chance of unintended external calls or command execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The detail-lookup examples are underspecified because phrases like 'tell me the hours' or 'is parking available' are common follow-up questions that may refer to many contexts, not necessarily a hospital already identified by this skill. If routed without verifying the target institution, the agent may perform unintended lookups, mis-associate a hospital, or leak user context to external services.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The routing rule maps very broad Korean keywords like search/find/recommend to this skill, which can overlap with ordinary health-related conversation rather than a clear hospital lookup request. Over-broad triggering can cause the agent to invoke networked scripts unexpectedly, disclose user queries to external services, or return medical-provider suggestions when the user did not explicitly ask for that action.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The setup instructions direct users to persist a long-lived API key in a predictable plaintext path under the home directory. Secrets stored this way are vulnerable to accidental disclosure through permissive file permissions, backups, logs, shell history, or compromise by other tools running with user access.

Content

Scanner excerpt · SKILL.md (reported line 100)May include surrounding context.

  1. 로그인 → 마이페이지 → 일반 인증키(Decoding) 복사
  2. API 키 저장:
    bash
    mkdir -p ~/.config/data-go-kr
    echo "YOUR_API_KEY" > ~/.config/data-go-kr/api_key
    
  3. 아래 서비스 활용신청 후 사용 (자동승인)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script accesses an API key from ~/.config/data-go-kr/api_key and exits with an error if it is missing, but there is no comment or user-facing warning explaining that the skill reads a locally stored credential. For code files, access to sensitive credentials should have some form of disclosure unless clearly communicated elsewhere in the skill description, which is not available here.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/hospital.sh (reported line 26)May include surrounding context.

sh
echo "시도: $SIDO_CD | 종별: $HOSP_TYPE" >&2

# 요청 실행
RESPONSE=$(curl -s -G "$URL" \
    --data-urlencode "serviceKey=$API_KEY" \
    --data "sidoCd=$SIDO_CD" \
    --data "pageNo=$PAGE_NO" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The curl invocation sends the serviceKey API credential to an external HTTPS endpoint, but the script does not provide a warning or disclosure that authentication data is being transmitted over the network. Although the script's purpose is to query a public API, the current file lacks any explicit notice about this credential-bearing outbound request.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The stated purpose is hospital information lookup, and network access to the public API is expected. However, directly reading a credential from ~/.config/data-go-kr/api_key introduces local secret access that is not disclosed by the manifest description and is a distinct capability beyond straightforward search behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script loads an API key from ~/.config/data-go-kr/api_key and uses it in outbound curl requests to an external API. While this is part of the script's functionality, the file provides no explicit warning that local credentials will be accessed and sent over the network.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/hospital_detail.sh (reported line 38)May include surrounding context.

sh
SELECTED=$(echo "$ITEMS" | tr ',' ' ')
fi

# 병렬로 curl 호출
for key in $SELECTED; do
    ep="${EP_MAP[$key]:-}"
    [ -z "$ep" ] && continue

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script reads an API key from a local file in the user's home directory, which is a privileged local-data access capability beyond pure argument-only hospital lookup logic. Even if needed for API authentication, this creates secret-handling risk because any invocation of the skill implicitly accesses local sensitive material, and the manifest/behavior should explicitly justify and constrain that access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger examples, routing logic, setup notes, and user-facing phrasing are presented only in Korean, which effectively forces a specific language experience. The file does not mention any user language choice, alternative locale, or explicit justification for restricting interaction language.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.