You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(security): validate feed/URI URLs and cap download size (#223)
Feed enclosure URLs (<enclosure url>) and obsidian://podnotes deep-link
URLs are fully attacker-controlled, yet flowed straight into requestUrl
with no scheme or host validation - a blind SSRF primitive (plus a
file:/data: local-read/exfil path via the transcription fetch). The
streaming download also had no total-size cap, so a malicious media
server could fill the disk.
- Add src/utility/assertFetchableUrl.ts: allow only http(s); reject
loopback/link-local/private/cloud-metadata hosts (IPv4 + IPv6,
including obfuscated, IPv4-mapped, and absolute-FQDN forms).
- Route every feed/URI-derived fetch through it: downloadFile and the
getFileExtension HEAD probe (downloadEpisode.ts), probeAndFetchFirstChunk
and writeStreamedFile (download/streaming.ts), and the feed-fetch branch
of the obsidian://podnotes handler (URIHandler.ts).
- Cap the streamed download at MAX_DOWNLOAD_SIZE (2 GiB): reject an
oversized advertised total or 200-fallback body up front, and abort the
206 loop once the running total exceeds the cap (stops the unknown-total
infinite-stream disk-fill).
deepsec: ssrf-2306e54f4d, ssrf-47eda4095e, ssrf-594c984897,
other-resource-exhaustion-54d62080a1
0 commit comments