Back to skill

Security audit

survey-form-generator

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it says, but it exposes a service token and generates HTML using unsafe raw template insertion that could run injected browser code.

Review before installing. This skill sends the survey goal to Dify for generation, and the distributed package contains a reusable API token that should be revoked and moved to protected runtime storage. The HTML template should also be fixed to safely encode embedded data before users open generated forms or enter sensitive responses.

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
SKILL.md:39
Finding

Hard-Coded Dify API Bearer Token

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:142
Finding

HTML and JavaScript Injection Through Unsafe Template Substitution

Content
View full analysis
__TITLE__ ``` ```html ` sequence inside a JSON string can terminate the script element before JavaScript parsing occurs. Attacker-controlled markup following that sequence can therefore become active document content and may execute JavaScript. The later `esc()` function used during DOM rendering does not address this issue because execution can occur while the browser initially parses the generated file, before those rendering protections are relevant. The source may be influenced in two ways: - A user can provide crafted survey input that the remote workflow reflects into a title, question, option, description, or other JSON string. - A compromised or malicious remote workflow response can directly provide the payload. ### Attack Path 1. An attacker supplies a crafted survey goal or causes the remote Dify workflow to ...[truncated 1308 chars]
Remediation
View remediation
`, `&`, U+2028, and U+2029. Ensure a literal `` cannot appear in the generated source. 5. Validate the remote response against a strict schema before rendering: - Permit only documented fields and question types - Enforce string and array length limits - Reject unexpected objects and properties - Constrain numeric ranges 6. Treat the Dify response as untrusted even when HTTPS is used. 7. Add a restrictive Content Security Policy to the generated page. Where practical, prohibit network connections with `connect-src 'none'` and avoid inline script execution. 8. Add regression tests containing payloads with ``, ``, HTML event handlers, quotes, angle brackets, and Unicode line separators. 9. Preserve DOM-safe rendering by continuing to use `textContent` for visible survey fields rather than constructing markup from untrusted strings. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

L003 将触发范围扩展到“帮我做个问卷”“设计几道题”“想调研一下”等宽泛表述,并明确要求“即使他们没有明确说出‘问卷’两个字”也应使用本技能。这种描述缺少边界和反例,容易与普通求助或泛化的内容设计请求冲突,导致误触发。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The embedded hard-coded bearer token exposes a live credential inside the skill definition, allowing unauthorized reuse by anyone who can read the file. This can enable abuse of the linked external service, incur cost, bypass intended access controls, and make the skill a vehicle for secret exfiltration.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill advertises local questionnaire generation/rendering, but its workflow transmits the user's survey goal and related content to a third-party API. This creates a privacy and transparency issue because user-provided business context, customer research plans, or potentially sensitive internal objectives may leave the local environment without clear disclosure or consent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The external transmission is real and materially relevant because the skill sends user-supplied survey content to api.dify.ai. In this context, the danger is not mere network use but undisclosed third-party data transfer of potentially sensitive planning, customer, or internal business information.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

第二步:调用生成服务

text
POST https://api.dify.ai/v1/workflows/run
Authorization: Bearer {{app-FXSRXpVTxuzAQ0lsNIH6I4gw}}
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation says the page does not upload responses to any server, but the skill also instructs sending user content to an external API during questionnaire generation. Even if end-user form responses stay local, the contradictory messaging can mislead users into sharing sensitive survey goals or internal research information under a false privacy assumption.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

HTML 模板在 L151 固定设置为 lang="zh-CN",且整份技能说明默认以中文输出和中文界面为前提,没有给用户语言/地区选择或声明仅适用于中文场景。这可能违反语言/区域选择应由用户决定的自然语言政策要求。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file uses Chinese for all user-facing natural-language content, but it does not indicate that the language is optional or region-specific. Under the language/locale policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.