Skip to content

fix(model-zoo): validate each redirect before following - #270

Merged
isLinXu merged 1 commit into
Tencent:mainfrom
onion-hong:codex/fix-model-zoo-redirects
Sep 11, 2026
Merged

fix(model-zoo): validate each redirect before following#270
isLinXu merged 1 commit into
Tencent:mainfrom
onion-hong:codex/fix-model-zoo-redirects

Conversation

@onion-hong

Copy link
Copy Markdown
Contributor

The model-zoo downloader validates only the final hostname after urllib has followed redirects. Apply the existing HTTPS/host policy before every redirect request, as well as before the initial request, and reject alternate ports and embedded credentials. Keep final-URL, declared-size and SHA256 checks.

Validation: 7 regression cases passed on this independent branch. Offline tests reject HTTP downgrade, non-allowlisted destinations, alternate ports and credentials before returning a redirect Request, accept the normal HTTPS release-asset path, verify use of the checked opener, and retain digest validation. Tests pass Ruff lint/format; production critical-error lint and git diff --check pass. No live exploit or external network probe was performed. Repository-wide lint/format have existing findings and codespell is unavailable.

Based directly on main b44ea12; limited to the downloader and its tests.

@isLinXu

isLinXu commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

LGTM

@isLinXu
isLinXu merged commit a065ad4 into Tencent:main Sep 11, 2026
12 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants