T09 · Insecure Skill Coding Practices
- Location
scripts/coda.sh:50- Finding
Unsafe JSON Construction from Untrusted Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 ;; esac body="$(jq -n \ --arg access "$3" \ --arg email "$2" \ '{access: $access, principal: {type: "email", email: $email}}')" _post -d "$body" "$BASE/docs/$1/acl/permissions" ``` Additional hardening measures should include: 1. Validate resource identifiers against the documented Coda identifier format where practical. 2. Validate email addresses before permission mutations. 3. Reject control characters and unreasonable argument lengths. 4. Require explicit confirmation before destructive or access-control operations when the script is used interactively. 5. Add regression tests using quotation marks, backslashes, newlines, and JSON structural characters in every text argument. ]]>
