nestjs-drizzle-crud-generator
Warn
Audited by Gen Agent Trust Hub on Mar 25, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The generator script
scripts/generate_crud.pyis vulnerable to code injection. It uses string interpolation to build TypeScript source code from JSON input provided at the command line without any sanitization or escaping. - Evidence: Functions like
generate_table_fields,generate_create_fields, andgenerate_filter_fieldsuse f-strings to insert field names directly into generated code, such asline = f" {name}: {drizzle_type}('{name}')"ingenerate_table_fields. A malicious input could break out of the string literal using characters like');to execute arbitrary TypeScript. - [COMMAND_EXECUTION]: The script is vulnerable to path traversal through the module and output directory parameters.
- Evidence: The
--outputand--featurearguments are used to construct file paths viaPath(base_path) / camel_name. Because the script does not validate these paths or check for parent directory references (e.g.,../), it can be coerced into writing files outside the intended project directory. - [PROMPT_INJECTION]: The skill is susceptible to indirect prompt injection as it processes untrusted data from user requests to generate code.
- Ingestion points:
SKILL.mdinstructs the agent to gather entity names and field lists from user interactions (Step 1). - Boundary markers: None present. The instructions do not include delimiters or validation steps for the input JSON.
- Capability inventory: The skill uses the
Writetool to create multiple files across a directory structure and executes a Python script that defines the content of those files. - Sanitization: No sanitization, escaping, or schema validation is performed on the
featureorfieldsinputs withinscripts/generate_crud.pybefore they are interpolated into templates.
Audit Metadata