T09 · Insecure Skill Coding Practices
Warning
- Location
- references/HTTP-REQUESTS.md:3
- Finding
- Configurable API Endpoint Can Expose Document Contents and Bearer Credentials## Vulnerability Details **File Location**: `references/HTTP-REQUESTS.md:3` **Vulnerability Type**: Unrestricted security-sensitive endpoint configuration **Risk Level**: Medium ### Vulnerable Code ```text POST JSON to `${AI_SKILLS_API_URL:-https://ai-skills.open-idea.net}/api/v1/word-analysis/word.analyze` with `Authorization: Bearer`, `Content-Type: application/json`, and a unique `Idempotency-Key`. Replace the operation for questions, comparisons, and exports; poll asynchronous tasks using the query address returned in the response. Read `X-AI-Skills-Billing-Currency`, `X-AI-Skills-Billing-Charged`, and `X-AI-Skills-Billing-Balance` for billing information. ``` The displayed snippet is an English rendering of the instruction at the cited location. Its endpoint expression and security-sensitive header names are reproduced exactly. ### Technical Analysis The request destination can be replaced through the `AI_SKILLS_API_URL` environment variable. The instructions do not require host allowlisting, certificate pinning beyond ordinary HTTPS validation, redirect restrictions, or verification that credentials remain on the expected origin. Requests carry the `WORD_ANALYSIS_API_KEY` as a bearer credential and include extracted document content. Consequently, anyone capable of influencing this environment variable can redirect both categories of sensitive information to another server. The issue does not independently grant an attacker the ability to set environment variables; exploitation requires control over deployment configuration, the process environment, or another mechanism that affects the skill's runtime configuration. ### Attack Path 1. An attacker or compromised configuration mechanism sets `AI_SKILLS_API_URL` to an attacker-controlled HTTPS origin. 2. A user invokes document analysis, question answering, comparison, or export functionality. 3. The agent follows the documented request procedure and constructs the API U ...[truncated 1004 chars]
- Remediation
- ## Remediation Suggestions - Pin requests to `https://ai-skills.open-idea.net` unless custom endpoints are an explicitly supported and security-reviewed requirement. - If endpoint customization is required, parse the URL and enforce an allowlist of exact HTTPS schemes, hostnames, and permitted ports. - Reject URLs containing user information, ambiguous host representations, fragments, or unexpected path prefixes. - Disable redirects for authenticated requests, or validate every redirect target and remove the `Authorization` header whenever the origin changes. - Ensure TLS certificate validation remains enabled and prohibit plaintext HTTP endpoints. - Keep endpoint configuration in trusted administrator-controlled configuration rather than accepting values from document content or ordinary user instructions. - Use narrowly scoped, revocable API keys and rotate a key immediately if requests may have reached an untrusted endpoint. - Obtain user authorization before transmitting sensitive document text, as already required by the skill's behavioral rules.
