pytest Test Framework

Warn

Audited by Gen Agent Trust Hub on Feb 21, 2026

Risk Level: MEDIUMCOMMAND_EXECUTIONREMOTE_CODE_EXECUTION
Full Analysis
  • Dynamic Execution (MEDIUM): The script generate-test.py creates Python test files by interpolating the --description and --source arguments directly into a code template. The interpolation in def test_{description...} and the docstring """Test: {description}""" only replaces spaces with underscores. It does not escape quotes, colons, or newline characters. An attacker-controlled description could break out of the intended function or docstring context to define additional malicious functions or execute arbitrary code when the file is later run by the agent.\n- Indirect Prompt Injection (LOW): This skill exposes a significant attack surface for indirect injection. \n
  • Ingestion points: The --description parameter in generate-test.py is intended to receive natural language descriptions of bugs or features, which may originate from untrusted external sources like GitHub issues or bug reports. \n
  • Boundary markers: None. The input is directly interpolated into a Python script template. \n
  • Capability inventory: run-test.py executes the generated code using pytest via subprocess.run (Category 10/Command Execution). \n
  • Sanitization: Minimal (space-to-underscore replacement only in the function name, none in the docstring).\n- Command Execution (LOW): run-test.py executes the pytest command. While it uses a list-based subprocess.run call that avoids shell injection, it is designed to execute the code generated by generate-test.py, facilitating the execution of any injected payloads.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Feb 21, 2026, 10:22 AM