SSRF hardening for server-side media fetches in the AI vision stage #108
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
download_first_imagefetches image URLs taken directly from postmedia_attachments(preview_url/url) server-side. Those URLs are chosen by the post's author (or their instance), so a malicious post can point fenliu's server at internal addresses — cloud metadata endpoints such as169.254.169.254, or any internal service — and probe them: a Server-Side Request Forgery vector (OWASP A10).PR #107 added
follow_redirects=Trueto this client (fixing #105, media_proxy redirects), which extends the surface: an initially-harmless URL can additionally redirect to an internal target. Note the underlying exposure exists without redirects, since the initial URL is already attacker-chosen.Constraints / notes
ai_classification.py) only calls the operator-configured base URL and is not affected.Raised by WuMing (security, HIGH) during review of PR #107; decision was to keep #105 minimal (it restores intended behaviour) and design the hardening properly here.