diagrams
Warn
Audited by Gen Agent Trust Hub on Sep 16, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The script
scripts/render-elk.mjsuseschild_process.execSyncto perform PNG conversions using the macOSsipsutility. The command string is constructed by concatenating filenames retrieved directly from the filesystem viareaddirSync. - Evidence: Filenames are wrapped in double quotes in the command string:
execSync(sips -s format png "${join(outDir, svgName)}" --out "${join(outDir, pngName)}" 2>/dev/null);. - Risk: If a file in the target directory has a name containing shell metacharacters (e.g.,
";touch RCE;".json), the shell may interpret the name as separate commands, leading to arbitrary code execution. - [DYNAMIC_EXECUTION]: The script employs dynamic module loading to import its primary dependency.
- Evidence:
const require = createRequire(process.cwd() + '/'); const ELK = require('elkjs');inscripts/render-elk.mjs. - Risk: This pattern loads the
elkjslibrary from the user's current working directory rather than a fixed path. This allows the execution of code from the project environment, which is a standard but sensitive operation. - [INDIRECT_PROMPT_INJECTION]: The skill acts as a data processing pipeline that ingests external, potentially untrusted JSON data to generate visual diagrams.
- Ingestion points:
scripts/render-elk.mjsreads and parses.jsonfiles from the filesystem. - Boundary markers: The script does not implement specific boundary markers or instructions to ignore embedded commands within the JSON data, though it is intended for structured data.
- Capability inventory: The script possesses file read/write capabilities (
fs.readFileSync,fs.writeFileSync) and shell execution capabilities (execSync). - Sanitization: The script uses an
escapeXmlfunction to sanitize text labels (label,title,subtitle) before injecting them into the SVG output, which helps mitigate XML/SVG injection risks.
Audit Metadata