T09 · Insecure Skill Coding Practices
- Location
SKILL.md:31- Finding
Mandatory API-Key Disclosure and Hardcoded Credential Generation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is mostly a 302.AI API helper, but it uses overly broad activation rules and unnecessarily asks for and embeds a live API key, so users should review it carefully before installing.
Install only if you intentionally want a 302.AI-focused integration helper. Do not paste a live API key into chat; configure credentials locally with environment variables or a secret manager, review generated code before running it, and confirm endpoints remain on the expected 302.AI domains before sending real project data.
SKILL.md:31Mandatory API-Key Disclosure and Hardcoded Credential Generation
SKILL.md:1Overbroad Proactive Routing Hijacks Unrelated API Requests
scripts/parse_api_list.py:52Unvalidated Remote Documentation Links Are Passed into WebFetch
There is a clear description-to-behavior mismatch. The description claims a broad, proactive skill for any API functionality, including automatic discovery across 302.AI's APIs and generation of integration code. The actual code only retrieves a text file listing APIs, parses its lines, performs basic local filtering by keyword/category, and prints results. It does not call downstream APIs, generate code snippets, integrate with AI/image/video/audio services, or implement logic to 'always use' the skill when API capabilities are mentioned. The primary purpose of the code is API catalog parsing/search, which is much narrower than the declared purpose.
The instruction to ALWAYS use this skill for any API functionality is an overly broad trigger that can hijack unrelated user requests and route them into a third-party integration workflow. In context, this is more dangerous because the skill also asks for a user's API key and encourages external lookups, increasing the chance of unnecessary credential solicitation and data transfer.
The trigger list includes vague categories such as 'any AI functionality' and 'API needs,' which are broad enough to match a large fraction of normal conversations. That creates a prompt-scope vulnerability: the skill can be invoked outside its legitimate domain and pressure users into providing API keys or using 302.AI when they did not ask for it.
The README states that the skill 'automatically' searches 1400+ APIs and fetches the latest API list in real time, but it does not provide a clear upfront privacy or network-use warning near that behavior. In an agent setting, this can lead users to disclose prompts, requirements, or metadata to external services without informed consent, making the behavior more risky than a normal static documentation example.
The README uses broad natural-language prompts like 'Integrate speech-to-text API' and explicitly says to 'always use this skill' for any API functionality. In an agentic environment, that can cause over-broad or unintended invocation, especially when user requests merely mention APIs or AI capabilities, increasing the chance of unnecessary network access, data disclosure to external services, or unexpected code generation.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
BASE_URL = "https://api.302.ai"
def call_gpt4(prompt):
response = requests.post(
f"{BASE_URL}/v1/chat/completions",
headers={
"Authorization": f"Bearer {API_KEY}",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
BASE_URL = "https://api.302.ai"
def call_gpt4(prompt):
response = requests.post(
f"{BASE_URL}/v1/chat/completions",
headers={
"Authorization": f"Bearer {API_KEY}",
The skill explicitly instructs use of network-capable behaviors (fetching API lists/docs and generating code that transmits data to external endpoints) but does not declare any tool scope or allowed-tools restrictions. That creates a governance gap: the runtime may permit broader-than-expected outbound access, and reviewers/users are not clearly informed what external actions the skill requires.
This code template sends arbitrary request data and an Authorization bearer token to an external API endpoint. In the context of a skill that proactively asks for a user's API key, this increases the risk of credential exposure, accidental transmission of sensitive prompts/data, and unsafe copy-paste practices if users embed secrets directly into generated code.
url = f"{BASE_URL}{endpoint}"
try:
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
The streaming example also transmits request data and credentials to an external endpoint, with less visible control over downstream handling because responses are streamed incrementally. In this skill context, the risk is elevated by the broad triggers and credential solicitation, which can normalize sending secrets or sensitive content to third-party services without sufficient user intent or review.
url = f"{BASE_URL}{endpoint}"
response = requests.post(url, headers=headers, json=data, stream=True)
for line in response.iter_lines():
if line:
This markdown file is entirely written in Chinese and presents itself as a general API integration template, but it does not offer users an alternative language or indicate that the skill is intentionally limited to a Chinese-speaking audience. Under the natural-language policy rule, forcing a specific language without opt-in is a locale-policy concern.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
url = f"{BASE_URL}{endpoint}"
try:
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
url = f"{BASE_URL}{endpoint}"
try:
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
});
## cURL 命令模板
### 基础请求
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST "https://api.302.ai/v1/endpoint" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST "https://api.302.ai/v1/endpoint" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
The document presents this file as the Chinese documentation variant ("English | 中文文档"), which indicates a fixed locale for the skill description rather than offering language choice within the file itself. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is clearly documented and justified.
The SVG element uses Chinese text values in id and data-name (_图层_1, 图层 1). This is a natural-language locale choice embedded in the file, and there is no indication that the asset is intentionally region-specific or that a locale choice is offered.
The entire skill document is written only in Chinese and does not offer any language or locale choice for users. Under the policy rule, forcing a specific language without opt-in can be a natural-language policy violation unless the regional restriction is explicitly documented and justified.
Line L188 states that the latest version will be automatically fetched before each use, but the provided file contains only static Markdown content and no code or mechanism to perform such retrieval. This is an intent/documentation contradiction within the skill materials rather than a mere omission, because it explicitly describes behavior not implemented here.
This markdown file presents all usage instructions, examples, and warnings only in Chinese. Under the policy rule for language or locale constraints, forcing a single language without user opt-in can be a natural-language policy issue unless the restriction is explicitly justified.
This code file contains natural-language strings that force a specific language/locale for documentation and CLI interaction. The policy scope for SQP-3 covers language or locale constraints unless the skill offers user choice or clearly documents a justified regional limitation, which is not present here.