T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/super_inline_html.js:15- Finding
Arbitrary Local File Inclusion in Self-Contained HTML Output
- Content
View full analysis
result = result.replace(/]*rel=["']stylesheet["'][^>]*href=["']([^"']+)["'][^>]*\/?>/gi, (match, href) => { if (href.startsWith('http') || href.startsWith('data:')) return match; const filePath = path.resolve(baseDir, href); if (!fs.existsSync(filePath)) return match; const css = fs.readFileSync(filePath, 'utf-8'); return `\n${css}\n`; }); // Inline `; }); // Inlineresult = result.replace(/]*src=["']([^"']+)["']/gi, (match, src) => { if (src.startsWith('http') || src.startsWith('data:')) return match; const filePath = path.resolve(baseDir, src); if (!fs.existsSync(filePath)) return match; const ext = path.extname(filePath); const dataUrl = fileToDataUrl(filePath, getMimeType(ext)); return match.replace(src, dataUrl); }); // Process blocks result = result.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi, (match, cssContent) => { const inlined = cssContent.replace(/url\(["']?([^"')]+)["']?\)/gi, (urlMatch, urlPath) => { if (urlPath.startsWith('http') || urlPath.startsWith('dat ...[truncated 2619 chars]
- Remediation
View remediation
