T09 · Insecure Skill Coding Practices
- Location
SKILL.md:313- Finding
Bearer Authentication Token Exposed Through URL Query Parameters
- Content
View full analysis
{ const cookieValue = req.query.myapp_cookie; if (typeof cookieValue === 'string' && cookieValue.length > 0) { res.cookie('myapp_cookie', cookieValue, { httpOnly: true, secure: process.env.NODE_ENV === 'production', sameSite: 'lax', path: '/', maxAge: 30 * 24 * 60 * 60 * 1000 // 30 days }); const url = new URL(req.originalUrl, `http://${req.headers.host}`); url.searchParams.delete('myapp_cookie'); res.redirect(302, url.pathname + url.search || '/'); return; } next(); }); ``` The corresponding usage instructions are: ```bash npx atxp-call https://your-domain.com/mcp myapp_cookie '{}' ``` ```text https://your-domain.com?myapp_cookie= ``` The server will set the HTTP-only cookie and redirect to clean the URL. ### Technical Analysis The cookie value is a bearer credential mapped directly to an ATXP account. Placing this credential in a query string can expose it through: - Browser history and synchronization services - Reverse-proxy, load-balancer, CDN, and web-server access logs - Application performance monitoring and analytics systems - Screenshots, copied URLs, support records, and browser automation traces - Referrer propagation under configurations that permit full or partial URL disclosure Redirecting to a clean URL only removes the credential from subsequent navigation. It does not rem ...[truncated 2474 chars]- Remediation
View remediation
