Jest Test Framework

Fail

Audited by Gen Agent Trust Hub on Feb 21, 2026

Risk Level: HIGHCOMMAND_EXECUTIONREMOTE_CODE_EXECUTION
Full Analysis
  • COMMAND_EXECUTION (HIGH): The run-test.js script is vulnerable to shell command injection. It constructs a command string for execSync by joining user-provided arguments (like --file and --config) without any sanitization or escaping. An attacker could use shell metacharacters (e.g., ;, &, |) to execute arbitrary commands on the system.
  • Evidence in run-test.js: const command = npx jest ${jestArgs.join(' ')}; followed by execSync(command, ...).
  • REMOTE_CODE_EXECUTION (HIGH): The generate-test.js script facilitates RCE by generating JavaScript files using simple string replacement. The --description argument is interpolated directly into the test template. If this input is controlled by an attacker (e.g., through a malicious bug report processed by the agent), they can inject arbitrary JavaScript code into the resulting test file.
  • Evidence in generate-test.js: let result = template...replace(/{{TEST_NAME}}/g, testName) where testName is derived from options.description.
  • INDIRECT_PROMPT_INJECTION (LOW): The skill exposes a significant attack surface for indirect prompt injection because it processes natural language descriptions to generate executable code.
  • Ingestion points: generate-test.js via the --description CLI argument, typically populated from external bug reports.
  • Boundary markers: Absent. The user input is directly injected into the template code.
  • Capability inventory: execSync in run-test.js (executes the generated code) and fs.writeFile in generate-test.js (persists the injected code).
  • Sanitization: Absent. No escaping or validation is performed on the description string before it is written to the filesystem.
Recommendations
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
Feb 21, 2026, 10:22 AM