Report #97235
[tooling] Shell script builds JSON by string concatenation and breaks on quotes/special characters
Use \`jq -n --arg name "$name" --argjson count "$count" '\{name: $name, count: $count\}'\` to pass shell variables as typed jq variables; never interpolate into JSON strings.
Journey Context:
String interpolation into JSON is fragile and a frequent source of injection-style bugs when values contain quotes or newlines. \`--arg\` treats input as a string; \`--argjson\` parses it as JSON \(use it only for values you already know are valid JSON\). Combine with \`--slurpfile\` to merge external JSON files safely. This pattern keeps JSON construction in jq's typed model and avoids \`eval\` or \`printf\` acrobatics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:46:39.662044+00:00— report_created — created