T09 · Insecure Skill Coding Practices
- Location
tools/style-diagnostic.ts:105- Finding
Unrestricted URL Probing Enables Server-Side Request Forgery
- Content
View full analysis
{ console.log('🔍 Probing style resources...\n'); const defaultUrls = [ 'https://cdn.example.com/styles/main.css', 'https://cdn.example.com/styles/critical.css', 'https://fonts.googleapis.com/css2?family=Inter', ]; const urlsToProbe = urls || defaultUrls; const results: { url: string; status: string; ok: boolean }[] = []; for (const url of urlsToProbe) { try { const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 5000); const response = await fetch(url, { method: 'HEAD', signal: controller.signal, }); clearTimeout(timeoutId); results.push({ url, status: `${response.status} ${response.statusText}`, ok: response.ok, }); } catch (error) { results.push({ url, status: `Error: ${error}`, ok: false, }); } } ``` ### Technical Analysis `cmdStyleProbe` performs server-side HTTP requests to every caller-supplied URL. It does not restrict URL schemes or destinations, resolve and validate host addresses, block private and link-local networks, or validate redirect destinations. The method returns HTTP status information, providing an attacker with a network-reachability oracle. The five-second timeout limits request duration but does not prevent SSRF. The function is exported, and `runStyleDiagnostic('probe', args)` passes its argument array directly to it. Exploitation therefore requires access to this exported diagnostic API or a command surface that exposes it. ### Attack Path 1. An attacker gains permission to invoke the style diagnostic function or a command mapped to `runStyleDiag ...[truncated 1056 chars]- Remediation
View remediation
