T09 · Insecure Skill Coding Practices
- Location
scripts/gmc-store-audit.mjs:20- Finding
Incomplete SSRF Protection Permits Access to Internal and Link-Local Network Resources
- Content
View full analysis
= 16 && Number(hostname.split(".")[1]) <= 31))) { throw new Error(`Access to private address "${hostname}" is blocked.`); } return parsed.href; } catch (err) { throw new Error(`Invalid or unsafe URL "${value}": ${err.message}`); } } async function fetchPage(url, opts = {}) { try { validateSafeUrl(url); } catch (e) { return { ok: false, status: 0, url, text: '', error: `Request blocked: ${e.message}` }; } const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), opts.timeout || 15000); try { const res = await fetch(url, { signal: controller.signal, headers: { 'User-Agent': 'Mozilla/5.0 (compatible; GMC-Auditor/1.0; +https://selofy.com)', 'Accept': 'text/html,application/xhtml+xml,*/*', 'Accept-Language': 'en-US,en;q=0.9', ...opts.headers, }, redirect: ...[truncated 4877 chars]- Remediation
View remediation
