T09 · Insecure Skill Coding Practices
- Location
src/channel.ts:1291- Finding
WTT Authentication Token Exfiltration Through Attacker-Controlled Media URLs
- Content
View full analysis
{ const url = String(urlRaw || "").trim().replace(/[),.;]+$/, ""); if (!url) return; if (!/^https?:\/\//i.test(url) && !/^\/?.*media\/[0-9a-f-]{16,}/i.test(url)) return; if (mediaUrls.includes(url)) return; mediaUrls.push(url); mediaTypes.push("image/png"); }; ``` ```ts async function downloadInboundMediaToLocal(params: { url: string; account: ResolvedWTTAccount; maxBytes: number; timeoutMs: number; }): Promise<{ path: string; contentType?: string; bytes: number }> { const headers: Record = { Accept: "image/*,*/*;q=0.8", }; if (params.account.token) { headers.Authorization = `Bearer ${params.account.token}`; headers["X-Agent-Token"] = params.account.token; } const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), Math.max(1000, params.timeoutMs)); let response: Response; try { response = await fetch(params.url, { method: "GET", headers, redirect: "follow", signal: controller.signal, }); } finally { clearTimeout(timeout); } ``` ```ts if (originalMediaUrls.length > 0) { indexedTopicMedia = await materializeInboundMediaForContext({ mediaUrls: originalMediaUrls, mediaTypes: originalMediaTypes, account: params.account, accountId: params.accountId, preferThumbnail: true, log: params.log, }); } ``` ### Technical Analysis The plugin extracts absolute HTTP or HTTPS URLs from inbound message text and recursively inspected message metadata. These URLs are later passed to the media downloader. The downloader adds the configured WTT toke ...[truncated 1806 chars]- Remediation
View remediation
