T09 · Insecure Skill Coding Practices
- Location
scripts/fetch-asr-recordings.mjs:11- Finding
Bearer Token Forwarding to Arbitrary Plaintext Endpoints
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is meant to analyze ASR call transcripts, but it handles bearer tokens, tenant identifiers, and transcript records with too little scoping or protection.
Review carefully before installing. This should not be used with real customer or employee recordings until endpoint allowlisting, HTTPS, tenant binding, validated time ranges, transcript/field minimization, and bounded/redacted error logging are added. The scripts also currently contain a JavaScript syntax error in parse-time-range.mjs, so the skill does not run as packaged.
scripts/fetch-asr-recordings.mjs:11Bearer Token Forwarding to Arbitrary Plaintext Endpoints
scripts/fetch-asr-recordings.mjs:69Caller-Controlled Tenant Identifiers Are Not Bound to Authenticated Token Claims
scripts/resolve-user-intent.mjs:106Confirmed Time-Range Override Bypasses Query Scope Limits
scripts/fetch-asr-recordings.mjs:89Entire Backend Recording Objects Are Exposed Instead of an Explicit Field Allowlist
scripts/fetch-asr-recordings.mjs:176Raw Non-JSON Backend Responses Are Written to Error Logs
Referenced artifact was not completely inspected
**禁止只跑 `fetch-asr-recordings.mjs` 而不先意图解析**(fetch 内置相同解析,若需反问会直接 `ok:false` 且不拉数)。
Referenced artifact was not completely inspected
## 时间规则(`parse-time-range.mjs`)
The skill explicitly documents use of environment variables and network access (LEGION_AUTH_TOKEN, LEGION_HARDWARE_BASE_URL, and calls to an internal HTTP service), but it does not declare any tool scope or allowed-tools boundary. This creates an overbroad execution surface where the runtime may grant undeclared capabilities, reducing reviewability and increasing the risk of unintended data access or network exfiltration if the skill or adjacent components are modified.
The skill processes ASR transcript content and sends data to an internal analysis service, but the user-facing description does not clearly warn that conversation-derived transcript data will be transmitted for backend analysis. This weakens informed consent and can expose sensitive customer or employee conversation content to internal systems without adequate transparency, which is especially concerning given the reporting and summarization workflow over recordings.
This code sends userId, orgId, time-range parameters, and a bearer token to a remote HTTP endpoint, but the script provides no confirmation prompt or user-facing disclosure before performing the request. The only visible messages are error responses for missing inputs, not warnings that sensitive identifiers and credentials will be transmitted over the network.
This file defines the skill’s analysis themes, keywords, and documentation entirely in Chinese, including user-interpreted labels such as "股票趋势", "拓客复盘", and "销售话术". Because the skill recognizes and returns Chinese-only themes without offering a language choice or documenting a justified region-specific restriction, it creates a locale policy issue.
The file’s comments and parsing logic indicate the skill is designed around Chinese phrasing and a fixed Asia/Shanghai locale, and the returned result also hard-codes that timezone. Under the policy, forcing a specific language or locale without offering user choice or documenting a justified region-specific constraint is a natural-language policy violation.
The resolver appends process.env.LEGION_USER_MESSAGE to the effective user input, meaning behavior can be influenced by out-of-band data not supplied in the current request. This creates an input-smuggling channel that can alter parsed time range, analysis focus, or output format, undermining trust in intent resolution and potentially causing unauthorized or misleading actions.
Clarification can be globally bypassed via process.env.LEGION_SKIP_CLARIFICATION === "1", which contradicts the skill’s described ask-first workflow and allows execution with defaults even when time range or analysis dimensions are missing or ambiguous. In practice this can silently suppress a safety/accuracy control and lead to data retrieval or reporting based on assumptions the user never confirmed.
The file-level comment and user-facing error strings are written only in Chinese, indicating an implicit language constraint with no opt-in or alternative locale handling. Under the policy, forcing a specific language without user choice or documented justification is a natural-language policy concern.
This file includes natural-language comments and usage guidance only in Chinese ("仅解析用户意图(不拉数)" and "用法"). Under the policy, forcing a specific language without user opt-in can be a locale/language policy violation, and there is no indication here that the skill offers an alternative language or that the constraint is justified.
The file-level description and all user-facing clarification strings are written exclusively in Chinese, indicating the skill expects or enforces Chinese-language interaction. There is no natural-language indication that users may choose another language or locale, which can violate language/locale policy requirements when no opt-in is provided.
This markdown template contains all user-facing text in Chinese, including headings, labels, and footer content. Under the policy rule for language/locale, forcing a specific language without opt-in or clear justification is a natural-language policy concern.