Back to skill

Security audit

Kinema's TDD Injector (CLAUDE.md generator)

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its TDD-instruction purpose, but it can make persistent repository changes and includes an under-scoped path that writes application configuration code, so users should review it before installing.

Install only if you are comfortable with a skill that writes persistent repository agent instructions. Before running it, confirm the exact target file, review the generated diff, avoid the custom config.py path unless you explicitly want application code changed, and prefer a pinned or locked Jinja2 environment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
references/ONBOARDING.md:13
Finding

Unpinned Jinja2 Dependency Is Resolved and Executed at Runtime

Content
View full analysis
/assets')) template = env.get_template('claude_md.j2') print('template loaded:', template.name) " ``` From `references/ONBOARDING.md:35`: ```bash uv run --with jinja2 python /scripts/render.py --help ``` From `references/ONBOARDING.md:42-50`: ```bash uv run --with jinja2 python /scripts/render.py \ --target claude \ --params /.kinema-params.tmp.json \ --out /.kinema-claude.draft.md uv run --with jinja2 python /scripts/render.py \ --target codex \ --params /.kinema-params.tmp.json \ --out /.kinema-agents.draft.md ``` From `SKILL.md:196-205`: ```bash uv run --with jinja2 python "/scripts/render.py" \ --target claude \ --params "/.kinema-params.tmp.json" \ --out "/.kinema-claude.draft.md" ``` The workflow also directs the user to install `uv` and retry if it is unavailable, while prohibiting direct Python invocation. From `README.md:65-66`: ```bash uv run --with jinja2 python scripts/render.py --target claude --params params.json --out CLAUDE.md uv run --with jinja2 python scripts/render.py --target codex --params params.json --out AGENTS.md ``` ### Technical Analysis The documented and ...[truncated 2591 chars]
Remediation
View remediation
' python scripts/render.py ... ``` 2. Define the renderer environment in a project dependency manifest and commit a `uv.lock` file containing the complete resolved dependency graph. 3. Run dependency installation and execution in locked or frozen mode so resolution fails rather than silently selecting newer packages. 4. Use package hashes or an integrity-verification mechanism where supported. Ensure artifacts are obtained from a trusted, authenticated package index. 5. Avoid resolving dependencies afresh during every Skill invocation. Prepare and review the execution environment during installation, then reuse the locked environment for rendering. 6. Add an automated check that rejects execution when the lockfile is missing, stale, or inconsistent with the dependency manifest. 7. Document a controlled dependency-update procedure that includes: - Reviewing release notes and dependency changes. - Regenerating the lockfile in a trusted environment. - Running security and functional tests. - Committing the reviewed lockfile with the update. 8. Consider removing the third-party runtime dependency entirely if the template can be rendered safely using a small, locally shipped implementation. Otherwise, ensure the template and all required dependencies are included and integrity-checked as part of the reviewed Skill package. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (17)

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
**拒绝条件**:仓库主要源码包含 **非 Python 且非 TS/JS 的语言**(顶层包里有 Go / Rust / Java / C++ 等)。零散脚本或 `.md` 文件不算。告知用户:"本规范目前只覆盖 Python + TS/JS,检测到 X 语言,无法生成。"

**升级模式**:目标仓库现有 `CLAUDE.md` 已包含 `<!-- kinema-tdd-injector: injected -->` 标记。这种情况**不拒绝**,进入升级模式:
1. 告知用户检测到既有注入,问是否要升级。读取头部 `injector-version:` 标识符并与本 SKILL.md 当前 `version` 比对;若旧版本低于当前,进入升级模式时告知版本差异(如"检测到 v1.3.0,当前 v1.4.0,建议升级")。无该标识符(更早产物)按未知旧版处理。
2. 同意后,从既有 CLAUDE.md 中**反解**上次的回答(覆盖率阈值、依赖模式、commit 风格、强制点、包管理器、自动触发设置、testenv 本地运行许可、配置来源),作为问卷默认值。
3. 用户回车即沿用旧值,输入新值即覆盖。

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
**拒绝条件**:仓库主要源码包含 **非 Python 且非 TS/JS 的语言**(顶层包里有 Go / Rust / Java / C++ 等)。零散脚本或 `.md` 文件不算。告知用户:"本规范目前只覆盖 Python + TS/JS,检测到 X 语言,无法生成。"

**升级模式**:目标仓库现有 `CLAUDE.md` 已包含 `<!-- kinema-tdd-injector: injected -->` 标记。这种情况**不拒绝**,进入升级模式:
1. 告知用户检测到既有注入,问是否要升级。读取头部 `injector-version:` 标识符并与本 SKILL.md 当前 `version` 比对;若旧版本低于当前,进入升级模式时告知版本差异(如"检测到 v1.3.0,当前 v1.4.0,建议升级")。无该标识符(更早产物)按未知旧版处理。
2. 同意后,从既有 CLAUDE.md 中**反解**上次的回答(覆盖率阈值、依赖模式、commit 风格、强制点、包管理器、自动触发设置、testenv 本地运行许可、配置来源),作为问卷默认值。
3. 用户回车即沿用旧值,输入新值即覆盖。

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the agent to write a project config.py implementation when users choose custom configuration-source combinations, even though the advertised purpose is one-time CLAUDE.md injection. This is a scope expansion into application code generation and modification, which can introduce insecure configuration loading logic, alter runtime behavior, and bypass normal code review expectations for a documentation-oriented skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill description emphasizes TDD setup but does not clearly warn that it will create or modify persistent instruction files like CLAUDE.md or AGENTS.md. Because those files can influence future agent behavior across the repository, omitting that warning undermines informed consent and increases the risk of stealthy or surprising persistence.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file presents the skill description, usage guidance, and trigger instructions in Chinese only, while claiming compatibility with Claude Code, Codex, and OpenClaw. Without an opt-in or documented language constraint, this can amount to an implicit locale restriction for users who do not read Chinese.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to match ordinary requests about setting up testing, which can cause the skill to activate when the user did not specifically intend to modify repository-level instruction files. In this skill’s context, activation leads to generating or upgrading persistent agent memory files such as CLAUDE.md or AGENTS.md, so an ambiguous trigger can cause unintended long-lived changes to a repo’s behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill clearly instructs the agent to read and write repository files, create temporary files, compare existing CLAUDE.md content, and rename or append files, yet it declares no explicit tool scope or allowed-tools boundary. Without an explicit capability restriction, the runtime may permit broader file operations than intended, increasing the chance of unintended repository modification or abuse if the skill is invoked in the wrong context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger phrases are broad enough to match ordinary requests about testing setup or methodology, causing the skill to activate in contexts where the user did not clearly request repository-wide injection behavior. Because this skill writes and may alter repository files, overbroad activation increases the risk of unintended modification and user confusion.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill is described as a one-time CLAUDE.md injector, but it also instructs the agent to perform git mv on repository test directories. That expands behavior from documentation generation into direct source-tree mutation, which can surprise users, break tooling, and create destructive or hard-to-review changes if the agent acts on the wrong directory or repository state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill allows immediate filesystem-affecting changes via git mv but does not frame them as high-impact repository modifications with clear warnings about side effects. In a repository-management context, renaming test directories can break imports, CI paths, editor settings, and developer workflows, so performing or even proposing the action without stronger safeguards is dangerous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The eval prompt is written in Chinese and directly instructs generation of CLAUDE.md in that context, implying a fixed language expectation. Under the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This prompt is also entirely in Chinese and specifies the skill behavior in that language, with no indication that users may choose another language. That creates the same fixed-locale issue covered by the policy.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · evals/evals.json (reported line 144)May include surrounding context.

json
"name": "codex-agents-md-target",
      "prompt": "使用 Codex 为这个 Python + TypeScript monorepo 注入 Kinema TDD 规范。",
      "expected_behavior": [
        "读取 skills/kinema-tdd-injector/SKILL.md 后继续完整读取根级 SKILL.md 与 references/ONBOARDING.md",
        "调用 render.py 时显式传入 --target codex",
        "草稿路径为 .kinema-agents.draft.md,最终写入根级 AGENTS.md",
        "不创建、不读取为升级源且不修改 CLAUDE.md",

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Line L03 states in Chinese that the document guides the AI agent through the first check, and the rest of the operational instructions are predominantly written in Chinese. This constitutes a language/locale policy concern because the file imposes a specific language without documenting user choice, opt-in, or a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE (reported line 594)May include surrounding context.

text
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE (reported line 606)May include surrounding context.

text
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code writes rendered content to an arbitrary output path provided by the user, which can overwrite existing files. While the CLI argument name suggests output behavior, there is no confirmation prompt, overwrite warning, or explicit comment/docstring near the write call explaining that an existing file may be replaced.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.