openai-image-gen
Pass
Audited by Gen Agent Trust Hub on Mar 9, 2026
Risk Level: SAFEPROMPT_INJECTION
Full Analysis
- [PROMPT_INJECTION]: The skill is susceptible to indirect prompt injection as it processes external input (prompts) to perform network and file operations.
- Ingestion points: The
--promptcommand-line argument inscripts/gen.pyaccepts arbitrary text. - Boundary markers: No delimiters or instructions are used to separate user-provided content from the system logic when building the API request or the HTML gallery.
- Capability inventory: The script can make network requests to the OpenAI API, download files from remote URLs via
urllib.request.urlretrieve, and write files to the local file system (images, JSON, and HTML). - Sanitization: While filenames are sanitized via a
slugifyfunction to prevent path traversal, the prompt text is inserted directly into theindex.htmlfile using f-strings without HTML escaping. This allows for HTML injection if a malicious prompt (e.g., containing<script>tags) is provided.
Audit Metadata