T09 · Insecure Skill Coding Practices
- Location
scripts/send.py:63- Finding
Ambiguous Contact Matching May Send Sensitive Messages to the Wrong Recipient
- Content
View full analysis
- Remediation
View remediation
1: raise ValueError("Ambiguous recipient label; use an exact ID") ``` 3. If partial matching is retained, collect all substring matches and proceed only when exactly one candidate exists. 4. Require an explicit `open_id`, `chat_id`, `user_id`, or `union_id` when a label is absent or ambiguous. 5. Consider returning candidate labels in an error response so the caller can choose explicitly, while avoiding unnecessary exposure of contact identifiers. 6. Add tests covering duplicate labels, overlapping labels, short substrings, empty labels, exact matches, and deterministic rejection of ambiguous input. ]]>
