Skip to content

Fix 2 issues flagged across 2 files - #5

Open
begininvoke wants to merge 2 commits into
WebPAI:mainfrom
begininvoke:redgem/security-fix-bfaf102d
Open

Fix 2 issues flagged across 2 files#5
begininvoke wants to merge 2 commits into
WebPAI:mainfrom
begininvoke:redgem/security-fix-bfaf102d

Conversation

@begininvoke

Copy link
Copy Markdown

A scan flagged a few things in this repository. This changes 2 files — one item each, described below.

1. eval/requirements.txt, around line 22

CRITICAL severity: Remote Code Execution in PyTorch (CVE-2025-32434). The project pins torch==2.2.0 in eval/requirements.txt (line 22), which is affected by a deserialization flaw where loading a crafted model checkpoint via torch.load() — even with weights_only=True, the historically 'safe' loading mode — allows arbitrary code execution on the host. Impact: any workflow that loads model weights from untrusted or semi-trusted sources (user uploads, public model hubs, shared artifacts, poisoned CI caches) becomes an RCE vector, potentially leading to full server compromise, credential/secret theft, and tampering with models or training data. Risk is rated CRITICAL because exploitation requires only delivering a malicious checkpoint file and it defeats the standard weights_only=True mitigation, so no code changes in the consuming application are needed for an attacker. Remediation: upgrade torch to >= 2.6.0 (patched version), regenerate any lock files, re-run the evaluation pipeline to confirm compatibility (including CUDA/torchvision matching versions), and review torch.load call sites to ensure only trusted artifacts are loaded going forward.

Upgrade torch and pillow to fixed versions to resolve critical CVEs.

For reference: rule CVE-2025-32434. Rated critical.

2. requirements.txt, around line 15

CRITICAL — Remote Code Execution in PyTorch model loading (CVE-2025-32434)

The pinned torch==2.5.1+cu121 in requirements.txt is vulnerable to a remote code execution flaw during deserialization. The key danger of this CVE is that it bypasses torch.load(..., weights_only=True), which developers have historically treated as the safe way to load model checkpoints. This means the usual mitigation pattern offers no protection.

Impact: Any code path that loads a model file from a source an attacker can influence (user-uploaded checkpoints, model registries, artifacts fetched from external storage, CI pipelines pulling third-party models) becomes an RCE vector — an attacker crafts a malicious model file, and loading it executes arbitrary code on the host with the service's privileges.

Risk level: CRITICAL (CVSS ~9.3). Exploitation is trivially scriptable, the vulnerable pattern (torch.load) is ubiquitous in ML services, and the common defense (weights_only=True) is ineffective in the affected versions.

Remediation: Upgrade to PyTorch >= 2.6.0, where the deserialization path is patched. Note: 2.6.0 does not publish +cu121 wheels — available CUDA builds are cu118/cu124/cu126 — so the CUDA variant pin (and any wheel index URL) must be updated as well. If torchvision/torchaudio are present, bump them to 0.21.0/2.6.0 for ABI compatibility.

Updates torch and pillow to versions fixing known CVEs.

For reference: rule CVE-2025-32434. Rated critical.

Take or leave whichever parts are useful. If this is not the right approach, closing is fine.


Found with automated scanning (RedGem) and reviewed before opening. If it is not useful, closing it is completely fine.

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.

1 participant