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
### Description
Harden the download/deserialization chain:
- Pass `weights_only=True` to pretrained weight loaders in `senet`,
`densenet`, `efficientnet`, and `text_embedding` so a substituted `.pth`
cannot unpickle code (GHSA-vm9c-7j6g-c7mm).
- `check_hash`: emit a `UserWarning` when no hash value is provided
instead of silently passing, and default `check_hash`/`download_url` to
`sha256` (GHSA-hhh4-h52m-fqh6).
- `download_large_files`: confine large-file targets to the bundle
directory, rejecting absolute and `../` traversal (GHSA-x4pc-gj5h-3pq7).
Note: SENet pretrained URLs remain `http://` because the upstream host
does not serve the files over HTTPS (verified unreachable);
`weights_only=True` closes the code-execution vector, leaving only a
transport-integrity gap.
### Types of changes
- [ ] Non-breaking change
- [x] Breaking change (default hash type changes from md5 to sha256 for
`check_hash`/`download_url`; callers that relied on the md5 default now
pass `hash_type` explicitly)
- [x] New tests added to cover the changes.
---------
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
0 commit comments