T09 · Insecure Skill Coding Practices
- Location
SKILL.md:353- Finding
Sensitive credentials and OAuth tokens exposed in URL query strings
- Content
View full analysis
dict: url = ( "https://graph.qq.com/oauth2.0/token" f"?grant_type=authorization_code&client_id={APP_ID}" f"&client_secret={APP_SECRET}&code={code}&redirect_uri={REDIRECT_URI}" "&fmt=json" ) return requests.get(url).json() # {"access_token": "...", "expires_in": 7776000, "refresh_token": "..."} # Obtain openid def get_openid(access_token: str) -> str: url = f"https://graph.qq.com/oauth2.0/me?access_token={access_token}&fmt=json" data = requests.get(url).json() return data["openid"] # Obtain user information def get_user_info(access_token: str, openid: str) -> dict: url = ( "https://graph.qq.com/user/get_user_info" f"?access_token={access_token}&oauth_consumer_key={APP_ID}&openid={openid}" ) return requests.get(url).json() ``` ### Technical Analysis The examples place an application secret, OAuth authorization code, and access tokens directly in URL query strings. Although the destinations are legitimate QQ HTTPS endpoints and these requests support the Skill's declared authentication functionality, query parameters are commonly recorded as part of the complete URL. Sensitive values may consequently appear in: - Application and reverse-proxy access logs - HTTP client debug logs - APM and distributed-tracing systems - Exception messag ...[truncated 1608 chars]- Remediation
View remediation
