T09 · Insecure Skill Coding Practices
- Location
scripts/remote-media.mjs:135- Finding
DNS Rebinding and Redirect-Based SSRF in Public Media Processing
- Content
View full analysis
!isPublicAddress(address, family)) ) { throw new Error("The media host did not resolve to public addresses."); } if (signal?.aborted) { throw new Error("The transcription timed out or was interrupted."); } } ``` The original hostname is subsequently passed to `yt-dlp`, which performs its own DNS resolution and may follow redirects: ```js async function inspectVideo( executable, url, { signal, runYtDlpImpl, environment }, ) { const output = await runYtDlpImpl( executable, [ ...baseYtDlpArguments(), "--skip-download", "--dump-single-json", "--extractor-args", "youtube:skip=translated_subs", "--", url.href, ], { signal, maximumStdoutBytes: MAXIMUM_METADATA_BYTES, environment }, ); return parseMetadata(output); } ``` The one-time validation is performed before the downloader is invoked: ```js await assertPublicHostname(url, lookupImpl, signal); ``` The same unpinned URL is also passed to subtitle and media download operations at lines 517–530 and 567–578. ### Technical Analysis This is a time-of-check/time-of-use validation flaw. `assertPublicHostname` verifies that a Node.js DNS lookup returns only public addresses, ...[truncated 2582 chars]- Remediation
View remediation
