T09 · Insecure Skill Coding Practices
- Location
scripts/approve_pairing.py:34- Finding
Path Traversal Through Unvalidated Channel and Account Identifiers
- Content
View full analysis
-allowFrom.json # If accountId is present → --allowFrom.json if account_id: allow_path = creds / f"{channel}-{account_id}-allowFrom.json" else: allow_path = creds / f"{channel}-allowFrom.json" ``` ### Technical Analysis The documentation limits operation to seven supported channels, but the script does not enforce that allowlist. The user-controlled `channel` argument is interpolated directly into filesystem paths. Path separators and parent-directory components such as `../` are not rejected. The `account_id` value obtained from the pairing JSON is also inserted directly into the destination filename. If the pairing file can be influenced, a malicious account identifier containing traversal components can affect the allowlist destination. `pathlib.Path` does not automatically const ...[truncated 1993 chars]- Remediation
View remediation
