T09 · Insecure Skill Coding Practices
- Location
TEMPLATES/article-pipeline.yaml:18- Finding
Untrusted Remote Content Is Propagated into AI Agents and Persistent Output Workflows
- Content
View full analysis
Vulnerability Details
File Locations:
TEMPLATES/article-pipeline.yaml:18-30, 40-41, 74-107TEMPLATES/getnote-to-article.yaml:27-41, 50-51, 145-157TEMPLATES/article-to-wiki.yaml:27-41, 50-51, 74-110TEMPLATES/research-pipeline.yaml:27-39, 48-49CHAIN.md:587-600
Vulnerability Type: Untrusted content propagation and indirect prompt injection
Risk Classification: T09: Insecure Skill Coding Practices
Risk Level: MediumVulnerable Code
The article workflow fetches an arbitrary user-selected resource and passes its content directly to a writing agent:
yaml step: 1 skill: web-content-fetcher trigger: User provides a URL or search term timeout: 30s input: source: "${user_input}" fetch_options: extract_images: true extract_links: true max_depth: 2 output: result_field: "content"yaml step: 2 skill: writing-agent depends_on: step_1 input: text: "${step_1.result.content}"The generated article is then passed into the WeChat upload workflow:
yaml step: 3 skill: wechat-mp-upload depends_on: step_2 input: text: "${step_2.result.article_text}" context: title: "${user.article_title || step_1.result.title}" auto_publish: "${user.auto_publish || false}"yaml step: 4 skill: wechat-mp-upload trigger: step_3 completed + user.auto_publish == true depends_on: step_3 optional: true input: action: publish content: "${step_3.result.formatted_content}"The GetNote workflow follows the same untrusted source-to-agent pattern:
yaml step: 1 skill: web-content-fetcher input: source: "${user.getnote_source}" fetch_options: extract_main_content: true preserve_formatting: true include_annotations: true output: result_field: "getnote_content"yaml step: 2 skill: writing-agent depends_on: step_1 input: ...[truncated 3985 chars]- Remediation
View remediation
Remediation Suggestions
-
Establish an explicit trust boundary
- Mark all webpage, note, search-result, annotation, and metadata content as untrusted.
- Pass source content through a dedicated field such as
untrusted_source_materialrather than placing it directly beside trusted workflow instructions.
-
Use strong prompt separation
- Wrap fetched content in fixed delimiters.
- Add a trusted instruction stating that directives found inside the delimited source are data and must never be followed.
- Prevent source material from changing tools, workflow actions, destinations, or safety constraints.
Example:
yaml input: action: analyze_untrusted_source security_policy: source_is_untrusted: true never_follow_embedded_instructions: true prohibit_tool_requests_from_source: true source_material: | BEGIN_UNTRUSTED_SOURCE ${step_1.result.content} END_UNTRUSTED_SOURCE -
Sanitize fetched content
- Remove scripts, hidden elements, HTML comments, invisible Unicode control characters, embedded metadata, and other non-content fields.
- Normalize links and reject dangerous or unexpected URI schemes.
- Retain original source provenance for review.
-
Add prompt-injection detection
- Scan fetched content for attempts to override instructions, request tool execution, disclose private context, or manipulate publishing behavior.
- Quarantine suspicious resources or require explicit user approval before continuing.
- Do not rely on content length or model confidence as security validation.
-
Validate generated output semantically
- Check for unexpected instructions, fabricated attribution, unapproved links, credential-like data, hidden markup, and content unrelated to the user’s request.
- Compare the output against the requested topic and trusted source claims.
- Use allowl ...[truncated 694 chars]
-
