T09 · Insecure Skill Coding Practices
- Location
scripts/tavily.py:63- Finding
Bearer Credential Exposure Through Cross-Origin HTTP Redirects
- Content
View full analysis
` header may be copied to the redirected request, including a request to a different origin. The hardcoded initial API base URL prevents direct destination injection, but it does not fully constrain subsequent redirect destinations. The security check is therefore performed too late to reliably protect the credential. ### Attack Path 1. A user or agent invokes any CLI operation, such as `search`, `extract`, `research`, or `usage`. 2. The script creates a request to `https://api.tavily.com` with `TAVILY_API_KEY` in the `Authorization` header. 3. Tavily's endpoint, or infrastructure controlling its response path, returns an HTTP redirect to an attacker-controlled origin. 4. `urllib.request.urlopen()` processes the redirect before control returns to the script. 5. If the r ...[truncated 995 chars]- Remediation
View remediation
