Back to skill

Security audit

流式AI检索问答技能

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a normal AI Q&A UI template, but its frontend streaming example can expose provider API keys and user messages.

Review before installing or copying into production. Use a backend or serverless route to hold provider API keys, restrict upstream endpoints, redact sensitive prompts where possible, and disclose third-party AI processing to users, especially for medical, legal, financial, or internal business data. The UI and prompts may also need localization if the deployment is not Chinese-language.

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

Warning
Location
references/frontend-pattern.md:151
Finding

Client-Side Exposure of LLM Provider API Credentials

Content
View full analysis
void, onDone: () => void, onError: (err: string) => void, ) { try { const res = await fetch(apiUrl, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}` }, body: JSON.stringify({ model, messages, stream: true, temperature: 0.3, max_tokens: 600 }), }); ``` ### Technical Analysis The documented function is presented as a frontend streaming implementation and accepts a provider API key directly in browser-executed code. It then places that credential in the outbound `Authorization` header. Secrets used by browser code cannot be reliably protected from end users or compromised client-side execution contexts. The key can be recovered through browser developer tools, request inspection, JavaScript breakpoints, malicious extensions, cross-site scripting, or inspection of application state. The function also accepts an unrestricted `apiUrl`. Consequently, configuration errors or attacker influence over that value could cause both the bearer credential and the complete `messages` payload to be transmitted to an unintended server. The messages may contain medical, legal, financial, or confidential internal knowledge-base information. Network transmission is necessary for the Skill's remote LLM functionality, and no hardcoded malicious endpoint was identified. However, transmitting a long-lived provider credential from frontend code exceeds the minimum privilege required: the browser only needs authorization to use an application-controlled backend, not direct possession of the upstream prov ...[truncated 1453 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Vague Triggers

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation criteria are extremely broad and include generic scenarios like any AI search box, knowledge-base QA, streaming answers, and transparent reasoning UI. This can cause the skill to trigger in many unrelated contexts, increasing the chance of inappropriate prompt injection into workflows, incorrect architectural guidance, or accidental override of more specific/safe skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill's natural-language description and user-facing labels are entirely in Chinese, presenting the interaction format as fixed rather than optional. There is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-only regional context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing natural-language strings that force a specific language/locale, including the default disclaimer and model/status labels. The policy explicitly disallows language or locale constraints unless the skill offers user choice or clearly documents a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file includes a streaming fetch example that sends messages and an Authorization bearer token to an external apiUrl. Because SQP-2 applies to markdown files when descriptions omit warnings about behaviors affecting privacy or system integrity, the lack of any accompanying warning about transmitting user content to a third-party API is a valid finding.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The prompt text is entirely prescriptive in Chinese and instructs the assistant to answer in that language, but it does not offer the user any language or locale choice. This creates a natural-language policy concern because the template implicitly fixes the interaction language without explicit user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This template instructs the assistant in Chinese and provides no option for users to choose another language. Under the policy, forcing a specific language without opt-in is a reportable natural-language policy violation unless the locale restriction is clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The instructions direct the model in Chinese to explain findings in plain language, but there is no mechanism for honoring user language preference. Because no regional justification is given, this appears to force a locale/language choice implicitly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The workflow and output format are specified entirely in Chinese and do not mention adapting to the user's chosen language. This can violate language/locale policy by hard-coding a language in a general-purpose prompt template.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

SQP-3 covers natural-language policy violations such as forcing a specific language without user opt-in. This reference material appears to require Chinese for labels, comments, and UI text, and it does not mention any user-selectable language option or region-specific justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.