T09 · Insecure Skill Coding Practices
- Location
scripts/deploy-folder.mjs:229- Finding
Short-Lived Bearer Token Exposed in Console Output
- Content
View full analysis
{ console.log("\n✅ Deployment successful!"); console.log(`Access URL: ${url}`); console.log("\n💡 Note: If you access the link too quickly, DNS resolution may not have taken effect yet. Please wait a moment and try again."); }) ``` ### Technical Analysis The deployment access token is a bearer credential. The scripts append it to the `esa_er_token` query parameter and print the complete URL to standard output. Query-string credentials are liable to be retained in CI/CD logs, Agent transcripts, terminal logs, shell-session recordings, screenshots, browser history, HTTP proxy logs, and referrer metadata. Anyone who obtains the complete URL can use the token without separately authenticating to the Alibaba Cloud account. The token has a documented default lifetime of one hour, which limits but does not eliminate the exposure window. Uploading deployment artifacts to the Alibaba Cloud-provided OSS URL is necessary for the declared functionality; printing the resulting bearer token is not. ### Attack Path 1. A user runs one of the deployment scripts. 2. The script calls `GetRoutineAccessToken` and receives a valid bearer token. 3. The token is appended to the deployed routine URL as a query parameter. 4. The complete tokenized URL is written ...[truncated 680 chars]- Remediation
View remediation
