Report #10418
[tooling] Shell variables injected into jq filters cause syntax errors or injection vulnerabilities
Use jq --argjson var "$VALUE" '. \+ \{field: $var\}' instead of string interpolation
Journey Context:
Developers often write jq ".foo = $VAR" which breaks on spaces, quotes, or valid JSON that jq interprets as syntax. --arg passes strings safely; --argjson parses the value as JSON \(numbers, objects, booleans\). This ensures type safety \(strings vs numbers\) and eliminates shell injection risks entirely, working correctly with arbitrary JSON content.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:42:16.505976+00:00— report_created — created