Back to skill

Security audit

AI PR Narrative Factory

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it automatically republishes GitHub PR-derived information into a permanent Feishu document without clear publication controls.

Install only if you are comfortable with PR information and AI-generated analysis being published to Feishu as a permanent shareable document. Use extra caution with private repositories, security fixes, unreleased product work, secrets accidentally present in diffs, or PRs from untrusted contributors; review the report and Feishu sharing settings before distributing the link.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
workflow.json:65
Finding

Indirect Prompt Injection Through Untrusted Pull Request Content

Content
View full analysis

Vulnerability Details

File Location: workflow.json, lines 65-77
Vulnerability Type: Indirect prompt injection caused by unsafe interpolation of untrusted content
Risk Level: High

Vulnerable Code

json
"inputs": {
  "pr_title": "{{steps.1.pr_title}}",
  "pr_description": "{{steps.1.pr_description}}",
  "diff_content": "{{steps.1.diff_content}}",
  "files_changed": "{{steps.1.files_changed}}",
  "context": "{{inputs.context}}"
},
"prompt_template": "你是一位资深软件架构师。请分析以下 Pull Request 的代码变更:\n\n## PR 信息\n标题:{pr_title}\n描述:{pr_description}\n作者:{pr_author}\n标签:{pr_labels}\n\n## 代码变更(Diff)\n{diff_content}\n\n## 涉及文件\n{files_changed}\n\n请分析并输出:\n1. **功能分类**:这是新功能 / Bug修复 / 重构 / 性能优化 / 文档更新 / 安全修复?\n2. **核心变更**:用1-2句话通俗描述这次变更做了什么\n3. **技术亮点**:关键技术实现或设计决策\n4. **破坏性变更**:是否有破坏性变更?如有,说明需要什么迁移\n5. **测试覆盖**:测试是否充分?需要手动验证的点\n6. **影响范围**:哪些模块/功能受影响?",
"outputs": [
  "change_category",
  "one_sentence_summary",
  "technical_highlights",
  "breaking_changes",
  "migration_guide",
  "test_notes",
  "impact_scope"
]

Technical Analysis

Pull request titles, descriptions, file names, and diff contents may be controlled by an untrusted pull request author. The workflow interpolates these values directly into an instruction-bearing AI prompt without applying structural isolation, escaping, content filtering, or an explicit rule that instructions found inside pull request data must not be followed.

A malicious contributor can place prompt-like directives in a pull request description, source-code comment, string literal, file name, or other diff content. Because this content appears in the same prompt context as the workflow's legitimate instructions, the model may interpret the embedded text as additional instructions rather than data to analyze.

The workflow also forwards the resulting analysis into subsequent summarization and publication steps. Consequently, successful injection can propagate attac ...[truncated 1568 chars]

Remediation
View remediation

Remediation Suggestions

  1. Treat all GitHub-derived values as untrusted data, including titles, descriptions, comments, labels, file names, and diff contents.
  2. Place untrusted content in clearly delimited structured fields rather than concatenating it into the main instruction text.
  3. Add a high-priority instruction stating that content inside the pull request is data only and that any instructions found within it must be ignored.
  4. Use a strict output schema with fixed field types, length limits, and allowed values. Reject output that does not conform.
  5. Add a second validation stage that checks whether conclusions are supported by the retrieved diff instead of blindly forwarding model output.
  6. Sanitize generated Markdown, URLs, mentions, and embedded content before publication.
  7. Require human review before publishing reports generated from untrusted or externally authored pull requests.
  8. Consider processing large diffs in isolated chunks and labeling every chunk as untrusted source material.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
workflow.json:119
Finding

Automatic External Publication Without Confirmation or Explicit Access Controls

Content
View full analysis

Vulnerability Details

File Location: workflow.json, lines 119-139
Vulnerability Type: Uncontrolled external disclosure and insufficient publication access control
Risk Level: High

Vulnerable Code

json
{
  "step": 4,
  "name": "发布飞书云文档",
  "skill": "feishu-create-doc",
  "action": "Create Feishu document with full report",
  "inputs": {
    "pr_url": "{{inputs.pr_url}}",
    "pr_title": "{{steps.1.pr_title}}",
    "pr_author": "{{steps.1.pr_author}}",
    "executive_summary": "{{steps.3.executive_summary}}",
    "technical_narrative": "{{steps.3.technical_narrative}}",
    "non_technical_narrative": "{{steps.3.non_technical_narrative}}",
    "breaking_changes": "{{steps.2.breaking_changes}}",
    "migration_guide": "{{steps.2.migration_guide}}",
    "changelog_entries": "{{steps.3.changelog_entries}}",
    "announcement_text": "{{steps.3.announcement_text}}",
    "team_communication": "{{steps.3.team_communication}}",
    "test_notes": "{{steps.2.test_notes}}",
    "files_changed": "{{steps.1.files_changed}}",
    "additions": "{{steps.1.additions}}",
    "deletions": "{{steps.1.deletions}}"
  }
}

Technical Analysis

The workflow automatically sends a detailed pull request report to the feishu-create-doc integration. The submitted information includes repository and pull request identifiers, author information, changed file names, technical implementation details, migration guidance, testing observations, and summaries derived from the complete diff.

No workflow input or intermediate step requires the user to approve publication. The configuration also does not specify document visibility, permitted recipients, tenant restrictions, link-sharing policy, expiration, or any other access-control setting. This creates a least-privilege and data-governance failure, particularly when the source pull request belongs to a private repository.

The documented behavior des ...[truncated 1948 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add an explicit user-confirmation step that displays the destination, data categories, and proposed visibility before publication.
  2. Default all generated Feishu documents to private and grant access only to explicitly selected users or groups.
  3. Add required workflow inputs for document owner, permitted recipients, tenant, sharing policy, and expiration period.
  4. Detect private repositories and show a prominent warning before transferring repository-derived information to Feishu.
  5. Provide a local-only or preview mode that returns the report without publishing it externally.
  6. Apply data minimization by excluding raw diffs, sensitive paths, internal identifiers, secrets, and unnecessary metadata from the publication step.
  7. Run secret and sensitive-data detection over source content and generated output before transmission.
  8. Record publication approval, destination, access-control settings, and document identifier in an audit log.
  9. Support revocation or expiration of generated links rather than describing them as permanently shareable.
  10. Ensure Feishu permissions are no broader than the source repository's authorized audience.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill describes automatic publication to a Feishu document with a permanent shareable link, but does not clearly warn the user that PR content and derived analysis will be sent to an external platform. This creates a substantial data-leak risk, especially for private repositories, sensitive diffs, security fixes, or internal discussion content extracted from the PR.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
77% confidence
Finding

The natural-language description is written as a Chinese-only experience and does not indicate that users may choose another language for prompts or generated reports. This can violate language-choice policy when a skill implicitly enforces a specific language without opt-in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger phrases are broad enough that ordinary PR-related requests could invoke this skill and cause unintended processing. In this skill’s context, accidental activation is more dangerous because the workflow culminates in publishing a report to Feishu, potentially disclosing internal code-change details without an explicit opt-in at the time of execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow sends PR-derived content, including diff_content-derived summaries, changelog text, and metadata, to Feishu in step 4 without any explicit user consent, warning, or scoping control. Because PRs may contain proprietary code, secrets accidentally committed to diffs, internal issue references, or sensitive architectural details, this creates a real data exfiltration/privacy risk through an external SaaS integration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The natural-language description states the behavior entirely in Chinese and presents the skill as generating reports for Feishu without indicating that users can choose their preferred language. The policy requires avoiding forced language/locale behavior unless there is explicit opt-in or a justified locale-specific scope.

Content

No source excerpt is available for this finding.