T09 · Insecure Skill Coding Practices
- Location
scripts/rss-digest.js:152- Finding
Registry-Controlled Feed URLs Permit Server-Side Request Forgery
- Content
View full analysis
controller.abort(), 20000); try { const res = await fetch(url, { method: 'GET', headers: { Accept: 'application/rss+xml, application/atom+xml, application/xml, text/xml;q=0.9, */*;q=0.8' }, signal: controller.signal }); clearTimeout(timeout); if (!res.ok) { throw new Error('HTTP ' + res.status + ' ' + (await res.text())); } return await res.text(); } catch (e) { clearTimeout(timeout); throw e; } } ``` ```js const fetchResults = await mapWithConcurrency(sources, 5, async source => { const feedUrl = normalizeRssUrl(source.rss_url); if (!feedUrl) { log('跳过无效 rss_url:' + (source.name || source.id || 'unknown')); return []; } try { const xml = await fetchTextByUrl(feedUrl); const parsed = parseRssOrAtom(xml, source); return parsed; } catch (e) { log('抓取失败:' + (source.name || source.id || 'unknown') + ' - ' + (e.message || e)); return []; } }); ``` ### Technical Analysis The feed registry is obtained from a remote service, and every `rss_url` supplied by that service is subsequently requested by the local process. The only validation applied to an absolute URL is whether it begins with `http://` or `https://`. The implementation does no ...[truncated 2259 chars]- Remediation
View remediation
