Skip to content

Bump torch lockfile resolution to 2.12.0 to clear GHSA-rrmf-rvhw-rf47 - #191

Merged
arnodelorme merged 2 commits into
developfrom
copilot/fix-pytorch-memory-corruption
Jun 12, 2026
Merged

arnodelorme merged 2 commits into
developfrom
copilot/fix-pytorch-memory-corruption

Conversation

Copilot AI commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Dependabot flagged torch==2.11.0 in uv.lock for CVE-2025-3000 / GHSA-rrmf-rvhw-rf47 (torch.jit.script memory corruption). This PR updates the resolved torch version to a non-vulnerable release with minimal dependency surface change.

  • Dependency update (uv-managed lockfile)

    • Updated uv.lock by running uv’s resolver for torch (no manual lockfile edits).
    • torch now resolves to 2.12.0 (previously 2.11.0).
  • Transitive lockfile adjustments

    • Resolver updated torch-coupled entries in uv.lock (CUDA/NCCL/Triton-related packages) required by the new torch resolution.
  • Reachability Assessment

    • Advisory targets torch.jit.script.
    • Repository search found torch imports in ICLabel modules, but no torch.jit.script / torch.jit call sites.
    • Current assessment: vulnerable API path is not directly used; update is primarily to satisfy vulnerability scanning and reduce latent risk.
    • Confidence: High (named API is specific and was directly searched).
# uv.lock
[[package]]
name = "torch"
version = "2.12.0"
Original prompt

This section details the Dependabot vulnerability alert you should resolve

<alert_title>PyTorch is vulnerable to memory corruption through its torch.jit.script function</alert_title>
<alert_description>A vulnerability classified as critical has been found in PyTorch 2.6.0. This affects the function torch.jit.script. The manipulation leads to memory corruption. It is possible to launch the attack on the local host. The exploit has been disclosed to the public and may be used.</alert_description>

low
GHSA-rrmf-rvhw-rf47, CVE-2025-3000
torch
pip
<vulnerable_versions>= 2.11.0</vulnerable_versions>
<patched_version></patched_version>
<manifest_path>uv.lock</manifest_path>

https://nvd.nist.gov/vuln/detail/CVE-2025-3000 https://github.com/pytorch/pytorch/issues/149623 https://github.com/pytorch/pytorch/issues/149623#issue-2935703015 https://vuldb.com/?ctiid.302049 https://vuldb.com/?id.302049 https://vuldb.com/?submit.524197 https://github.com/pypa/advisory-database/tree/main/vulns/torch/PYSEC-2025-194.yaml https://github.com/advisories/GHSA-rrmf-rvhw-rf47

<task_instructions>Resolve this alert by updating the affected package to a non-vulnerable version. Prefer the lowest non-vulnerable version (see the patched_version field above) over the latest to minimize breaking changes. Include a Reachability Assessment section in the PR description. Review the alert_description field to understand which APIs, features, or configurations are affected, then search the codebase for usage of those specific items. If the vulnerable code path is reachable, explain how (which files, APIs, or call sites use the affected functionality) and note that the codebase is actively exposed to this vulnerability. If the vulnerable code path is not reachable, explain why (e.g. the affected API is never called, the vulnerable configuration is not used) and note that the update is primarily to satisfy vulnerability scanners rather than to address an active risk. If the advisory is too vague to determine reachability (e.g. 'improper input validation' with no specific API named), state that reachability could not be determined and explain why. Include a confidence level in the reachability assessment (e.g. high confidence if the advisory names a specific API and you confirmed it is or is not called, low confidence if the usage is indirect and hard to trace). If no patched version is available, check the alert_description field for a Workarounds section — the advisory may describe configuration changes or usage patterns that mitigate the vulnerability without a version update. If a workaround is available, apply it and leave a code comment referencing the advisory identifier explaining it is a temporary mitigation. If neither a patch nor a workaround is available, explain in the PR description why the alert cannot be resolved automatically so a human reviewer can take over. Inspect the repository to determine which package manager is used (e.g. lock files, config files, build scripts) and use that tooling to perform the update — do not edit lock files directly. If the version constraint in the manifest (e.g. package.json, Gemfile, pyproject.toml) caps the version below the fix, update the constraint first. For transitive dependencies, determine whether it is simpler to update the direct dependency that pulls in the vulnerable package or to update the transitive dependency directly, and choose the least disruptive approach. If upgrading to fix the vulnerability forces a major version bump or known breaking changes, review the changelog or release notes, then audit the codebase for usage of affected APIs and fix any breaking changes that are found. If the package manager fails to resolve dependencies (e.g. peer dependency conflicts, incompatible engine constraints), document the error in the PR description rather than attempting increasingly complex workarounds. After updating, check the lock file to confirm the package no longer resolves to a version in the vulnerable range. Keep changes minimal and tightly scoped. Ensure tests, build, type checking, and linting all pass after your changes. If there are any test, lint, or typechecking failures, investigate whether they are caused by the update and fix them if so — do not leave broken tests in the PR. If they were already present before the update, note them in the PR description so a human reviewer can assess whether they are related.</task_instructions>

Copilot AI changed the title [WIP] Fix memory corruption in PyTorch's torch.jit.script function Bump torch lockfile resolution to 2.12.0 to clear GHSA-rrmf-rvhw-rf47 Jun 11, 2026
Copilot AI requested a review from suraj-ranganath June 11, 2026 08:18
@suraj-ranganath
suraj-ranganath marked this pull request as ready for review June 11, 2026 08:21
@suraj-ranganath

Copy link
Copy Markdown
Member

@claude review this

@claude

claude Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @suraj-ranganath's task in 2m 28s —— View job


PR Review — torch 2.11.0 → 2.12.0 (GHSA-rrmf-rvhw-rf47)

  • Gather context (diff, lockfile changes, torch usage)
  • Verify torch resolves to 2.12.0 and CVE is addressed
  • Check reachability claim (torch.jit.script usage)
  • Check transitive dep changes (CUDA / NCCL / Triton)
  • Verify pyproject.toml constraints
  • Post review

Summary

LGTM — small, scoped, lockfile-only change. The advisory lists = 2.11.0 as the sole vulnerable version, and the lock now resolves torch to 2.12.0 (uv.lock L3643-3644), which clears the alert. Reachability assessment is correct.

Verification

1. Advisory coverage. vulnerable_versions: "= 2.11.0"; new resolution 2.12.0 is outside the range. ✔

2. Reachability of torch.jit.script.

$ rg 'torch\.jit'
(no matches)

ICLabel's only torch surface is torch.nn.Module + tensor ops (src/eegprep/plugins/ICLabel/iclabel_net.py:8,12, iclabel.py:31). No JIT, no torch.jit.script, no torch.jit.load. The reachability claim in the PR description is correct, high confidence.

3. Manifest constraint. pyproject.toml:46 declares torch>=2.0; no constraint bump needed, and the resolver was free to pick 2.12.0 without manifest edits. ✔

4. Lowest-non-vulnerable-version rule. Since 2.11.0 is the only flagged version and 2.12.0 is the next release, this is the lowest non-vulnerable version. ✔

Transitive changes (expected for torch 2.12)

package before after
nvidia-cudnn-cu13 9.19.0.56 9.20.0.48
nvidia-cusparselt-cu13 0.8.0 0.8.1
nvidia-nccl-cu13 2.28.9 2.29.7
triton 3.6.0 3.7.0
nvidia-cublas (via cuda-toolkit[cublas] extra) now direct dep of torch

All five are Linux-only (marker = "sys_platform == 'linux'") and only pulled when the optional [torch] extra is installed. The cuda-toolkit[cublas] extra block disappears (uv.lock L42-45 of the diff) because torch 2.12 declares nvidia-cublas directly instead of pulling it through cuda-toolkit's extra — net effect on installs is equivalent. ICLabel's runtime path is CPU-friendly, so the GPU stack bumps carry low blast radius for EEGPrep.

Findings / things to be aware of

  • Unrelated wheel-row drops in the lockfile (worth a note in the PR description, not a blocker). The diff also deletes several non-torch wheel rows:

    • cryptography-48.0.0 ppc64le rows for cp311-abi3, cp314-cp314t, cp39-abi3 (six entries)
    • greenlet-3.2.5 s390x rows for cp310/cp311/cp312/cp313/cp314 (five entries)

    These platforms (ppc64le, s390x) are not in EEGPrep's supported targets and the rows were apparently dropped when uv re-resolved against the current registry/tag set. The change is benign — those wheels were never installable on supported runners — but the PR description's claim "Resolver updated torch-coupled entries in uv.lock" undersells it; this is a broader resolver-state refresh. Suggest amending the PR description to mention it so a reviewer doesn't have to puzzle out the cryptography/greenlet rows.

  • No code or docs changes required. No call sites of the affected API, no torch-version-pinning examples in docs. Confirmed docs/source/user_guide/{advanced_topics,installation}.rst only show import torch boilerplate.

  • CI signal. I did not run the suite locally for this review (pure lockfile change, no code under test). The full test job on this PR is the real gate — make sure tests/test_iclabel*.py (and any other test that loads torch) is green before merging.

Verdict

Approve in spirit. The vuln fix is correct, minimal, and well-reasoned. Two soft asks before merge:

  1. Add a one-line note to the PR description acknowledging the unrelated cryptography/greenlet ppc64le/s390x wheel drops (so reviewers don't flag them as suspicious churn).
  2. Confirm uv run pytest tests -k "iclabel or torch" (or the full CI run) passes against the new lockfile.

@arnodelorme
arnodelorme merged commit f85bdbd into develop Jun 12, 2026
8 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.

3 participants