fix(download): require trust for injected sessions - #9524
Open
wunianze666-netizen wants to merge 1 commit into
Open
fix(download): require trust for injected sessions#9524wunianze666-netizen wants to merge 1 commit into
wunianze666-netizen wants to merge 1 commit into
Conversation
wunianze666-netizen
requested review from
JPPhoto,
Pfannkuchensack,
blessedcoolant,
dunkeroni and
lstein
as code owners
August 21, 2026 09:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requests.Sessionfrom silently bypassing the socket-level SSRF guard while private-address downloads are disabledrequests_session_is_trustedopt-in and reject untrusted injected sessions in the guarded configurationallow_private_download_urls=trueopt-outThe default production path is unchanged: when no session is injected, the download queue creates its SSRF-guarded session as before.
Related Issues / Discussions
Refs #9493, specifically follow-up item 6.
This PR intentionally does not close #9493 because that issue tracks several independent download-queue security follow-ups.
QA Instructions
Local validation:
py -m pytest tests/app/services/download/test_download_queue.py -q— 38 passedgit diff --checkpassedAdditional SSRF-suite validation produced 59 passing tests and one unchanged Windows environment failure:
urllib.getproxies()reads the machine's system proxy registry. The failure is unrelated to this patch.Reviewers may want to focus on the compatibility boundary:
Merge Plan
No special merge steps are required. This is a single backend security commit with focused tests and documentation; it does not change database schemas, Redux state, generated assets, or release metadata.
Checklist
What's Newcopy (if doing a release after this PR) — N/A, this is not a release PR