Skip to content

v2.4.1 — Security Patch (SSRF Fix)

Choose a tag to compare

@Shineii86 Shineii86 released this 27 Aug 09:48
· 7 commits to main since this release

🔒 Security Patch — SSRF Fix

Critical security fix for unauthenticated Server-Side Request Forgery (SSRF) in the stream proxy endpoints.


🛡️ Security

  • CRITICAL: Fixed unauthenticated SSRF in /api/stream/proxy and /api/stream/ts-proxy
    • The proxy endpoint domain allowlist had an escape hatch (pathname.endsWith(".m3u8")) that let any host through as long as the path looked like a playlist
    • /api/stream/ts-proxy had no destination check at all — the URL went straight to axios.get
    • Both could be used to fetch internal services (127.0.0.1, 169.254.169.254) and read responses
  • Added shared streamProxy.helper.js with:
    • Real allowlist by registrable domain (subdomains covered)
    • Private/loopback/link-local/CGNAT address blocking as second layer
    • HTTPS-only scheme enforcement
  • Removed dead domain megaplay-1.buzz from allowlist
  • Added vid-tube.site and CDNs currently serving streams (norami.top, kryntal.top, akirax.buzz)
  • Added SECURITY.md with vulnerability reporting policy

🐛 Fixed

  • Environment loading: Fixed dotenv.config() being called after static imports — helpers reading process.env at module top level (mirror, cache, proxy, streamProxy) were never receiving .env values. Changed to import "dotenv/config" as the first import so .env is populated before any helper module loads
    • Affected settings: MIRROR_DOMAINS, MIRROR_CACHE_TTL, CACHE_MAX_SIZE, CACHE_DEFAULT_TTL, SCRAPER_API_KEY, FLARESOLVERR_URL, STREAM_PROXY_DOMAINS, STREAM_PROXY_REFERER

✨ Added

  • Stream Proxy Allowlist Config: New STREAM_PROXY_DOMAINS env var to override the built-in domain allowlist (comma-separated)
  • Stream Proxy Referer Config: New STREAM_PROXY_REFERER env var to override the Referer header sent to stream CDNs (default: https://megaplay.buzz/)
  • Maintenance Badge: Added to README
  • Security Contributors: Credit to @jamil182 in README and CHANGELOG

🧪 Tests

  • Marked upstream-dependent tests (Servers, Stream Resolve, Upcoming, Top Rankings, Recently Updated, Completed, Status, OpenAPI) as optional: true — they skip gracefully when the scraping target blocks requests

📦 Files Changed

File Change
src/helper/streamProxy.helper.js New — SSRF guard with allowlist + private IP blocking
SECURITY.md New — vulnerability reporting policy
server.js dotenv load order fix
src/routes/apiRoutes.js Proxy validation using shared guard
test.js Upstream-dependent tests marked optional
.env.example New config vars documented
package.json Version 2.4.0 → 2.4.1
README.md Maintenance badge + security credits
CHANGELOG.md v2.4.1 entry
docs/*.md Version references updated

🙏 Credits

Thanks to @jamil182 for discovering and fixing this vulnerability, and for the security policy.

Full Changelog: 2.4.0...v2.4.1