Back to skill

Security audit

Ai Paper Pipeline

Security checks for vulnerabilities and agentic risk

Overview

This paper-workflow skill is mostly coherent, but it gives agents broad execution, credential-adjacent, and Git-commit authority without enough safeguards against leaking secrets or making persistent changes.

Install only if you want an agent to actively scaffold and manage a research-paper repository. Before use, require explicit approval for file creation, package installs, external API calls, and every Git commit. Do not let the agent write API keys or token values into PROGRESS.md, logs, or commits; record only variable names and whether they are configured.

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
MEGA_PROMPT.md:273
Finding

Environment-variable logging combined with mandatory Git commits may expose API credentials

Content
View full analysis

Vulnerability Details

File Location: MEGA_PROMPT.md:273-278, MEGA_PROMPT.md:309-315, and SKILL.md:89-91
Vulnerability Type: Potential plaintext credential disclosure through project logs and version control
Risk Level: Medium

Complete Vulnerable Snippets

MEGA_PROMPT.md:273-278:

bash
export OPENAI_API_BASE="<大模型 API 基础路径>"
export OPENAI_API_KEY="<大模型 API_KEY>"
export OPENAI_MODEL_NAME="<默认大模型名称>"
export KAGGLE_API_TOKEN="<KAGGLE_TOKEN>"
export TAVILY_API_KEY="<TAVILY_KEY>"

MEGA_PROMPT.md:309-315:

text
### 环境记录
你必须在 PROGRESS.md 中记录每次环境配置的细节,包括:
- 安装的库(requirements.txt)
- 版本号
- 配置的环境变量

### Git 版本控制
你应该将代码和论文草稿都放在 Git 仓库中,每个阶段结束后提交一次,记录提交信息。

SKILL.md:89-91:

text
## Final step

After modifying this skill or creating paper-project files in the workspace, commit the changes with a clear git message.

Technical Analysis

The example credentials are placeholders rather than live secrets. The vulnerability arises from the interaction of three instructions:

  1. The workflow expects sensitive API credentials to be configured as environment variables.
  2. It requires environment-configuration details to be recorded in PROGRESS.md without specifying that only variable names may be recorded or that values must be redacted.
  3. It instructs the Agent to commit project changes to Git.

An Agent could reasonably interpret “record every environment configuration detail” as including environment-variable values. If live API keys or tokens are copied into PROGRESS.md, the subsequent commit instruction places those credentials in repository history. Removing the values in a later commit would not remove them from earlier Git objects.

No hard-coded live credential was found in the audited files. This is an insecure workflow design that can cause credential disclosure when the Skill is used with real credentials.

Attack Path

  1. A user configures live OPENAI_API_KEY, KAGGLE_API_TOKEN, or TAVILY_API_KEY value ...[truncated 1311 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the environment-recording instruction with an explicit redaction policy:

    • Record only environment-variable names and whether they are configured.
    • Never record values, partial values, hashes, or command output containing secrets.
    • Use entries such as OPENAI_API_KEY: configured; value not recorded.
  2. Add secret-management requirements:

    • Load secrets from an approved secret manager or an untracked .env file.
    • Provide a .env.example containing placeholders only.
    • Add .env, credential files, local configuration files, and generated logs to .gitignore.
  3. Harden the commit workflow:

    • Require explicit user approval before creating a commit.
    • Inspect staged changes with git diff --cached.
    • Run a secret scanner such as Gitleaks, TruffleHog, or GitHub secret scanning before every commit.
    • Abort the commit when token-like patterns are detected.
  4. Add safe documentation examples:

text
## Environment log
- OPENAI_API_KEY: configured; value intentionally omitted
- KAGGLE_API_TOKEN: configured; value intentionally omitted
- TAVILY_API_KEY: not configured
  1. If exposure has already occurred:
    • Revoke and rotate every affected credential immediately.
    • Remove secrets from the working tree.
    • Rewrite Git history using an appropriate history-cleaning tool.
    • Force-update affected remotes where authorized.
    • Notify collaborators to discard old clones and verify service audit logs for unauthorized use.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (22)

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill instructs recording environment-variable configuration details in PROGRESS.md, a persistent project file. In context, the environment contains API keys and tokens, so this creates a direct path for sensitive secrets to be written into plaintext artifacts, committed to version control, or shared with collaborators.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Keep the main workflow concise in `SKILL.md` and push bulky reference text into `references/`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Keep the main workflow concise in `SKILL.md` and push bulky reference text into `references/`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Keep the main workflow concise in `SKILL.md` and push bulky reference text into `references/`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Keep the main workflow concise in `SKILL.md` and push bulky reference text into `references/`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Keep the main workflow concise in `SKILL.md` and push bulky reference text into `references/`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Keep the main workflow concise in `SKILL.md` and push bulky reference text into `references/`.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file is written as a direct operating instruction in Chinese and does not provide any opt-in, alternative language option, or explanation that the workflow is limited to a Chinese-language context. Under the locale policy, forcing a specific language without user choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

The explicit --auto-approve mechanism is a concrete bypass for manual gating controls. In this skill's context, where the workflow spans code generation, execution, external API use, and iterative decision-making, the bypass materially increases operational and security risk by reducing opportunities to catch misuse before it occurs.

Content

Scanner excerpt · MEGA_PROMPT.md (reported line 87)May include surrounding context.

md
## 🔄 决策循环机制

**门控阶段**(5、9、20)可暂停等待人工审批,也可用 `--auto-approve` 自动通过。拒绝后流水线回滚。

**循环触发点**:
- **第 15 阶段**可触发 **REFINE**(→ 第 13 阶段)或 **PIVOT**(→ 第 8 阶段),自动版本化之前的产物。

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

The explicit --auto-approve mechanism is a concrete bypass for manual gating controls. In this skill's context, where the workflow spans code generation, execution, external API use, and iterative decision-making, the bypass materially increases operational and security risk by reducing opportunities to catch misuse before it occurs.

Content

Scanner excerpt · MEGA_PROMPT.md (reported line 87)May include surrounding context.

md
## 🔄 决策循环机制

**门控阶段**(5、9、20)可暂停等待人工审批,也可用 `--auto-approve` 自动通过。拒绝后流水线回滚。

**循环触发点**:
- **第 15 阶段**可触发 **REFINE**(→ 第 13 阶段)或 **PIVOT**(→ 第 8 阶段),自动版本化之前的产物。

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The prompt explicitly instructs the agent to read API-related environment variables and use external services and tools from the host environment. In a paper-workflow skill, this expands the skill from document generation into credential-adjacent tool orchestration, increasing the risk of unauthorized API usage, unintended data exfiltration to third-party services, and abuse of paid accounts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The prompt tells the agent to use API keys and environment variables without warning about sensitivity, minimization, or safe handling. This normalizes secret access and may cause the agent to surface, misuse, or transmit credentials in logs, prompts, or external requests.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill authorizes installing arbitrary libraries, configuring environments, and using Docker, which exceeds a file-oriented paper workflow and grants broad system-modification latitude. This can lead to supply-chain risk, system destabilization, persistence changes, or execution of unreviewed code under the guise of running experiments.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description is broad enough to trigger on generic requests to organize prompts, update files, or structure projects, which can cause over-activation outside the user's intended scope. In a system that auto-selects skills, this increases the chance of unintended file creation or modification in unrelated workspaces.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The instruction to initialize project files and directories authorizes substantial workspace modifications, but it does not require explicit user confirmation or warn that files will be created. This can lead to unexpected writes, especially if the skill is invoked automatically or on ambiguous requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Automatically committing changes writes permanent repository history and may capture unintended edits, sensitive content, or noisy scaffolding without the user's informed approval. Because git commits are harder to undo cleanly and can trigger downstream automation, this is more dangerous than ordinary file writes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file is entirely authored in Chinese and presents the workflow as the operative template, but it does not state that Chinese is optional, user-selected, or required for a region-specific purpose. Under the language/locale policy, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

The matched token 'auto-approve' reflects the same risky behavior: approval gates can be automatically passed despite being designated control points. Because this skill is a reusable paper-production pipeline with mandatory iterative loops and autonomous branching (REFINE/PIVOT), bypassing approvals makes the automation materially more dangerous than in a passive reference document.

Content

Scanner excerpt · references/full-pipeline-template.md (reported line 60)May include surrounding context.

md
25. REBUTTAL ← 根据审稿意见进行针对性优化,包含实验和论文

门控阶段(5、9、20)可暂停等待人工审批,也可用 --auto-approve 自动通过。拒绝后流水线回滚。

决策循环:非常重要,必须循环,这不是一个线性顺序的流程。

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

The matched token 'auto-approve' reflects the same risky behavior: approval gates can be automatically passed despite being designated control points. Because this skill is a reusable paper-production pipeline with mandatory iterative loops and autonomous branching (REFINE/PIVOT), bypassing approvals makes the automation materially more dangerous than in a passive reference document.

Content

Scanner excerpt · references/full-pipeline-template.md (reported line 60)May include surrounding context.

md
25. REBUTTAL ← 根据审稿意见进行针对性优化,包含实验和论文

门控阶段(5、9、20)可暂停等待人工审批,也可用 --auto-approve 自动通过。拒绝后流水线回滚。

决策循环:非常重要,必须循环,这不是一个线性顺序的流程。

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file is written entirely in Chinese and presents default rules and output structure without indicating that language should follow user preference. In a multi-user environment, this can force responses or generated artifacts into a language the user did not request, increasing the risk of misunderstanding requirements, incorrect edits, or inaccessible project documentation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description says it should be used whenever the user asks to generate a paper pipeline, organize a paper project, turn a mega prompt into a reusable skill, structure literature→experiment→writing loops, or create/update multiple project files. These triggers are broad and overlap with many ordinary planning or writing requests, which can cause the agent to invoke the skill in situations the user did not clearly intend, leading to unintended file creation or workflow changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

Line L79 tells the user to copy the template to the project root as MEGA_PROMPT.md, which is a file-writing action. The surrounding markdown does not warn about possible overwriting of an existing file or advise the user to back up or verify the destination first.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.