T09 · Insecure Skill Coding Practices
- Location
scripts/assethub_api.sh:155- Finding
Bearer Tokens Can Be Disclosed to Arbitrary Network Destinations
- Content
View full analysis
``` to the attacker-controlled server. 5. The attacker reuses the token against AssetHub until it expires or is revoked. ### Impact Assessment An attacker can obtain the current ...[truncated 448 chars]- Remediation
View remediation
&2 exit 1 fi ``` 2. Accept only relative API paths beginning with `/`. 3. Canonicalize the resulting URL and enforce an exact scheme, hostname, and port match with a trusted `ASSETHUB_API_URL`. 4. Maintain a strict endpoint allowlist where practical. 5. Never attach authorization headers across redirects. Add `--max-redirs 0`, or validate every redirect destination before following it. 6. Apply the same destination validation to both user JWTs and IoT tokens. 7. Add regression tests proving that absolute URLs, protocol-relative URLs, malformed URLs, and cross-origin redirects cannot receive credentials. ]]>
