Back to skill

Security audit

test-fixture-generator

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a straightforward pytest fixture generator, with ordinary project-file overwrite risks when saving generated code.

Install only if you are comfortable with a Chinese-language pytest helper that can write generated code into your project. Before running init or using --output, check whether the target file already exists, especially conftest.py, because the CLI does not ask before replacing it. Review generated database and AWS fixtures before running tests against environments that might contain real resources.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The natural-language documentation appears to assume a single language for all users and does not offer an alternative locale or explain that the skill is intended only for a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in is a language/locale policy violation.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill content, including headings and operational description, is presented in Chinese, which can impose a language constraint on users without any opt-in or explanation. The file does not indicate that the skill is region-specific or provide an alternative language option.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger list includes generic technical terms like "fixture", "pytest fixture", and "conftest", which are common in ordinary developer conversations. This can cause the skill to activate unintentionally in unrelated contexts, leading to unsolicited code generation or interference with other tooling behavior.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
When --output is provided, the command writes text directly to the specified path with no confirmation or warning if the file already exists. The success message appears only after the write, so the user is not informed in advance of the potentially destructive file operation.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The init command writes generated content directly to the user-supplied output path, defaulting to conftest.py, without any confirmation or overwrite warning. Although it prints a message after writing, there is no prior disclosure that an existing file may be replaced.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
This Python file contains user-facing natural-language strings and docstrings entirely in Chinese, including the module and class descriptions. Under the policy, forcing a specific language without user opt-in or a clearly documented regional justification is a locale/language policy violation.

Intent-Code Divergence

Medium
Confidence
82% confidence
Finding
The method documentation at L092-L093 says it generates an "API mock fixture", which implies uniformly mocked/non-real external interactions. However, the boto3 template selected at L097 ultimately instantiates actual boto3 clients in L399 and L406, with safety relying on surrounding moto mocking and environment setup rather than the client itself being intrinsically a mock object. This is an intent-level mismatch in the code's own documentation.

Missing User Warnings

Low
Confidence
89% confidence
Finding
This markdown file documents commands that generate fixtures and initialize `conftest.py`, including `--output` paths and a default `conftest.py` target. Because these actions write project files, the skill description should explicitly warn users that files will be created or overwritten to avoid unintended data loss or repository changes.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The natural-language docstring describes the skill only in Chinese ("自动生成pytest fixtures的工具"), which can indicate a language-specific presentation without user opt-in. The policy requires flagging language or locale constraints when no choice or justification is provided.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
This code file's human-facing natural language is consistently written in Chinese in docstrings and comments, with no indication that language choice is optional or user-selected. Under the stated policy, forcing a specific language without opt-in is a locale/language policy concern even when it appears in code comments or string literals.

Static analysis

No suspicious patterns detected.