fix(pytorch): distinguish producer metadata from runtime CVEs#1643
fix(pytorch): distinguish producer metadata from runtime CVEs#1643mldangelo-oai wants to merge 9 commits into
Conversation
|
@codex review |
Performance BenchmarksCompared
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a34c3cd99
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Pinned applicability QA input: both |
|
Addressed the pinned SafeTensors applicability QA in Summary:
Validation:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4878ad61b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex address these exact-head blockers before merge:
Independent report: |
|
Addressed the fresh exact-head blockers in Summary:
Validation:
@codex review |
|
Exact-head follow-up pushed on Additional repair after CI: CodeQL flagged clear-text logging in the trusted torch metadata lookup fallback. I removed exception/path interpolation from that debug path without changing CVE applicability behavior. Validation after this last patch:
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Mark runtime-version-gated PyTorch CVE applicability inconclusive when producer metadata is present but no trusted local runtime version is available. Preserve producer-only false-positive suppression by keeping the CVE checks skipped instead of critical.
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Exact-head CI blocker for
Both expect |
Avoid embedding a PyTorch-looking producer version string in the clean benchmark ZIP payload so the performance lane continues to benchmark a successful release-candidate repository under unknown local runtime conditions.
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 136716630c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Independent review of exact head
Validation: 40 focused PyTorch ZIP controls, 272 HF source tests, and 7 CLI streaming controls passed. Release-candidate cold/warm scans pass only after removing generic semver. Real Torch 2.11 happy/malicious paths behaved as expected. All six threads are resolved; static/benchmark/Docker checks are green, with four Python/Windows lanes still running. The P1/P2 issues block merge. |
Summary
Root Cause
The PyTorch ZIP scanner selected embedded checkpoint metadata, such as pickled producer PyTorch version strings, as the version input for runtime CVE gates when local PyTorch was absent. A benign pinned Hugging Face checkpoint produced by PyTorch 2.0.1 therefore emitted CRITICAL runtime CVEs even though the scanner had not established the consumer runtime version.
Security Tradeoff
Producer metadata remains recorded in scan metadata and in a new INFO provenance check. Runtime CVE checks now require local environment evidence. Artifact-level exploit evidence still fails independently, so malicious pickle payloads and structural CVE evidence are not suppressed.
Pinned Hugging Face QA
Model: pyannote/wespeaker-voxceleb-resnet34-LM @ 837717ddb9ff5507820346191109dc79c958d614
Baseline on origin/main 2f782ba:
Outcome: exit 1 with CRITICAL CVE-2025-32434, CVE-2026-24747, CVE-2024-5480, and CVE-2024-48063 from producer metadata source
pickle:pytorch_model.310/data.pkl.After this fix:
Outcome: exit 0 / Clean; critical CVE list
[]; producer metadata still reportspytorch_framework_version=2.0.1andpytorch_version_source=pickle:pytorch_model.310/data.pkl; provenance check reportsruntime_cve_version_gate=local_environment_only.Validation
uv run ruff format modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/-> 419 files left unchangeduv run ruff check --fix modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/-> All checks passeduv run mypy modelaudit/ packages/modelaudit-picklescan/src packages/modelaudit-picklescan/tests tests/-> Success: no issues found in 474 source filesPROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest -n auto -m "not slow and not integration" --maxfail=1-> 17369 passed, 1292 skippedPROMPTFOO_DISABLE_TELEMETRY=1 MODELAUDIT_RUN_HF_E2E=1 uv run pytest tests/scanners/test_pytorch_zip_scanner.py::test_pinned_huggingface_pyannote_checkpoint_does_not_emit_metadata_only_runtime_cves -q-> 1 passedgit diff --check-> cleanControls
pytorch_version_source=local_environment.