Back to skill

Security audit

日本雅虎拍卖估价

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent auction-estimation purpose, but its script can run unintended shell commands from auction IDs or proxy settings and may print proxy credentials.

Review or patch the script before installing in an environment with secrets or broad file access. Use only trusted auction IDs, avoid embedding credentials in PROXY_SOCKS5, and prefer a version that uses safe argument arrays or a native HTTP client with strict ID and proxy validation.

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/estimate.mjs:15
Finding
Shell Command Injection Through Auction ID and Proxy Configuration<![CDATA[ ## Vulnerability Details **File Location**: `scripts/estimate.mjs:8, 15-18, 25, 177` **Vulnerability Type**: OS command injection **Risk Level**: High ### Vulnerable Code ```js const PROXY = process.env.PROXY_SOCKS5 || 'socks5://127.0.0.1:1080'; // 辅助函数:执行curl命令 function curl(url) { try { return execSync( `curl -s --proxy ${PROXY} -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)" "${url}" 2>/dev/null`, { encoding: 'utf8', timeout: 30000 } ); } catch (e) { return ''; } } ``` The URL passed to this function contains a command-line argument: ```js async function getProductInfo(id) { const url = `https://auctions.yahoo.co.jp/jp/auction/${id}`; const html = curl(url); ``` The product IDs originate directly from process arguments: ```js async function main() { const ids = process.argv.slice(2); ``` ### Technical Analysis The application builds a shell command by interpolating two untrusted values into a template string passed to `execSync()`: 1. `PROXY` is populated from the `PROXY_SOCKS5` environment variable and is inserted into the command without shell quoting. 2. `id` originates from a command-line argument and is incorporated into `url`. Although the URL is enclosed in double quotes, shell command substitution and certain other shell expansions remain active inside double-quoted strings. Because `execSync()` executes the resulting string through a shell, shell metacharacters in either value can change the intended command structure. The application does not validate auction IDs or parse and constrain the proxy URL before command construction. The 30-second timeout limits execution duration but does not prevent an injected command from running or spawning an independent process. ### Attack Path 1. An attacker obtains the ability to influence an auction ID supplied to the Skill, or the `PROXY_SOCKS5` environment variable. 2. The attacker supplies a value containing shell syntax, such as command ...[truncated 1118 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not invoke `curl` through a shell. Use `execFileSync()` or `spawnSync()` with a separate argument array: ```js import { execFileSync } from 'child_process'; function curl(url) { try { return execFileSync( 'curl', [ '-s', '--proxy', PROXY, '-H', 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)', url ], { encoding: 'utf8', timeout: 30000, shell: false } ); } catch { return ''; } } ``` 2. Prefer a native Node.js HTTP client with explicit proxy support, removing the command-execution boundary entirely. 3. Validate each auction ID before constructing the URL. If Yahoo Auction IDs are expected to contain one letter followed by digits, enforce a strict allowlist such as: ```js if (!/^[a-z][0-9]+$/i.test(id)) { throw new Error('Invalid auction ID'); } ``` 4. Parse `PROXY_SOCKS5` with the `URL` class. Permit only required schemes such as `socks5:` and reject malformed values, unexpected protocols, control characters, and unsupported components. 5. Run the Skill with a minimally privileged account, a restricted environment, and only the filesystem and network access needed for auction estimation. 6. Add security tests covering shell metacharacters, command substitution syntax, whitespace, quotes, and malformed proxy URLs. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/estimate.mjs:189
Finding
Proxy Credentials Exposed in Terminal and Application Logs<![CDATA[ ## Vulnerability Details **File Location**: `scripts/estimate.mjs:8, 189` **Vulnerability Type**: Sensitive information exposure through logging **Risk Level**: Low ### Vulnerable Code The proxy setting can contain a complete proxy URL supplied through the environment: ```js const PROXY = process.env.PROXY_SOCKS5 || 'socks5://127.0.0.1:1080'; ``` The complete value is printed during every invocation: ```js console.log('🏷️ Yahoo Auction Estimator'); console.log(`🌐 代理: ${PROXY}`); console.log(`📦 共 ${ids.length} 个商品\n`); ``` ### Technical Analysis Proxy URLs frequently embed authentication information in the authority component, for example a username and password. Printing the complete `PROXY` value can therefore disclose credentials to terminal history, captured agent output, CI/CD logs, centralized logging platforms, monitoring systems, or other users who can inspect process output. The disclosure occurs unconditionally when the program starts. No redaction or credential detection is performed. ### Attack Path 1. An operator configures `PROXY_SOCKS5` with an authenticated proxy URL containing a username, password, or access token. 2. The Skill reads the complete URL into `PROXY`. 3. During startup, the Skill writes the entire value to standard output. 4. A terminal recorder, CI runner, agent transcript, or log collector stores that output. 5. A user or system with access to the captured output obtains the proxy credentials and may reuse them until they are rotated or revoked. ### Impact Assessment The issue can expose proxy authentication credentials to parties with access to application output. Compromised credentials may permit unauthorized consumption of the proxy service, attribution of attacker traffic to the legitimate account, bypass of source-network restrictions, or additional service charges. The direct scope is limited to secrets embedded in the proxy value and does not itself grant operating-system privileges. The practica ...[truncated 129 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not print the complete proxy URL. 2. If proxy diagnostics are necessary, parse the value and display only non-sensitive fields such as the protocol, hostname, and port. 3. Explicitly remove or mask usernames, passwords, tokens, and sensitive query parameters before logging: ```js function redactProxy(proxyValue) { try { const parsed = new URL(proxyValue); if (parsed.username) parsed.username = 'REDACTED'; if (parsed.password) parsed.password = 'REDACTED'; return parsed.toString(); } catch { return '[configured proxy]'; } } console.log(`Proxy: ${redactProxy(PROXY)}`); ``` 4. Prefer logging only whether a proxy is configured rather than its address. 5. Review existing terminal captures, CI logs, and agent transcripts for previously exposed credentials. Rotate affected proxy credentials and remove retained sensitive output where possible. 6. Configure logging systems to redact URL user-information fields as an additional defense-in-depth control. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (5)

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill declares operational capabilities via metadata requirements and documented shell usage, but does not explicitly constrain tool scope with permissions or allowed-tools. In an agent environment, this can lead to broader-than-necessary command or environment access, increasing the chance of unintended command execution, secret exposure, or misuse of proxy/network settings.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The script builds a shell command with string interpolation and passes both the proxy value and URL into execSync without safe argument separation. PROXY comes directly from an environment variable and the URL includes a user-controlled auction ID, so shell metacharacters in either value could trigger command injection and arbitrary command execution.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The markdown states that the tool performs timezone conversion specifically from Japan to China, which imposes a locale-specific output format. The file does not indicate that users can opt out, choose another locale, or that the China-specific conversion is required for a region-specific compliance purpose.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The description is written only in Japanese and specifies a Japan-specific auction tool, which may impose a language/locale expectation without offering user choice. The file does not document any opt-in, alternative locale support, or justification for restricting the skill to Japanese-language usage.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The file header presents the tool name in Japanese and Chinese, and all runtime user-facing messages are in Chinese, which indicates a fixed language choice. There is no visible option or documentation allowing users to select another language or opt in to this locale behavior.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/estimate.mjs:19