Skip to content

Conversation

@depthfirst-dev
Copy link

Overview

Upgrade transitive dependencies: starlette and torch

Upgrade

This PR upgrades transitive dependencies to address security vulnerabilities:

  • starlette: Upgraded from 0.47.1 to 0.48.0 (target: 0.47.2, upgraded to latest available)
  • torch: Upgraded to 2.9.0+cu126 on Linux (from 2.6.0+cu124), remains at 2.7.1 on macOS and Windows

The starlette upgrade required adding a direct dependency constraint (starlette>=0.47.2) to pyproject.toml. The PyTorch upgrade includes a CUDA version update from CUDA 12.4 to CUDA 12.6 for Linux builds.

Changes

  • Added direct starlette dependency constraint: Added starlette>=0.47.2 to ensure the security fix is enforced across all dependency resolution paths
  • Updated CUDA configuration: Changed from CUDA 12.4 (cu124) to CUDA 12.6 (cu126) to support PyTorch 2.9.0+cu126
  • Updated PyTorch source indexes: Modified tool.uv.sources to use the cu126 index instead of cu124
  • Updated comments and documentation: Updated inline comments to reflect new CUDA versions and PyTorch versions
  • Lock file updates: Updated uv.lock with all transitive dependency changes and new resolution markers

Warnings

  • Platform-specific torch versions: PyTorch was upgraded to 2.9.0+cu126 on Linux only. macOS and Windows remain at 2.7.1 due to package availability constraints in their respective indexes. This means macOS and Windows builds still have PyTorch vulnerabilities (CVE-2025-3730, CVE-2025-2953)
  • CUDA version change: The upgrade changes CUDA from 12.4 to 12.6 for Linux. Note that PyTorch 2.8.0+ with CUDA 12.9.1 has a known issue where torch.segment_reduce() is not available. This PR uses CUDA 12.6, which does not have this limitation
  • PyTorch 2.9.0 breaking changes: While PyTorch 2.9.0 has minimal breaking changes to the Python API, there are updates to the libtorch ABI for C++/CUDA extensions. If your project uses custom C++/CUDA extensions, they may need recompilation

Vulnerabilities Fixed

CVE-2025-54121 / GHSA-2c2j-9gv5-cj73

Starlette denial-of-service vector when parsing large multipart forms

When parsing multi-part forms with large files (greater than the default max spool size), starlette would block the main thread to roll the file over to disk. This blocks the event loop, preventing new connections from being accepted. The vulnerability is fixed in starlette 0.47.2 by checking if additional bytes will cause a rollover before writing synchronously.

  • Severity: Low impact for most users
  • Affected versions: All versions before 0.47.2
  • Fixed in: starlette 0.47.2 (included via upgrade to 0.48.0)
  • References: Security Advisory, Fix PR

CVE-2025-3730 / GHSA-887c-mr87-cxwp

PyTorch improper resource shutdown or release vulnerability

A vulnerability in the torch.nn.functional.ctc_loss function can lead to denial of service through improper resource management. The attack requires local access.

  • Severity: Problematic
  • Affected versions: All versions up to and including 2.7.1
  • Fixed in: PyTorch 2.8.0
  • Platform status: ✅ Fixed on Linux (2.9.0+cu126), ⚠️ Not fixed on macOS/Windows (still at 2.7.1)
  • References: GitHub Issue, Fix PR

CVE-2025-2953 / GHSA-3749-ghw9-m3mg

PyTorch local denial of service in mkldnn_max_pool2d

A vulnerability in the torch.mkldnn_max_pool2d function can lead to local denial of service. The exploit has been publicly disclosed.

  • Severity: Problematic
  • Affected versions: All versions up to and including 2.6.0
  • Fixed in: PyTorch 2.7.1-rc1 (and therefore 2.8.0+)
  • Platform status: ✅ Fixed on Linux (2.9.0+cu126), ⚠️ Partially fixed on macOS/Windows (2.7.1 is above the fixed version threshold)
  • References: GitHub Issue, Security Policy

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.

0 participants