torchvision arbitrary file write via tar archive extraction
Affects torchvision versions before 0.29.2 when attacker-controlled archives are passed to extract_archive() or download_and_extract_archive(). Fixed in 0.29.2.
- Exploited
- No known exploitation
- Fix
- Fixed in 0.29.2
- Who is exposed
- Specific setups only
Summary
The torchvision package has a path traversal flaw in its tar archive extraction that lets files be written outside the intended folder. An attacker can reach it remotely, without logging in, by supplying a crafted tar archive that a user extracts, and can overwrite Python modules to run code.
Written by a model
Original description
torchvision before 0.29.2 contains a path traversal vulnerability in _extract_tar() that allows attackers to write files outside the extraction directory by supplying crafted tar archives. Attackers controlling archives passed to extract_archive() or download_and_extract_archive() can use .. paths, absolute paths, or symlinks to overwrite Python modules and achieve code execution.
Who should check
Teams running torchvision before 0.29.2 that extract tar dataset archives with extract_archive() or download_and_extract_archive(), including ML development, notebook, CI, or training environments
“torchvision before 0.29.2 contains a path traversal vulnerability in _extract_tar()”
What to do
Check whether your setup matches what the bug needs.
torchvision versions before 0.29.2 Attacker-controlled archives are passed to extract_archive() or download_and_extract_archive()Upgrade to a fixed version: 0.29.2.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-137507 (torchvision before 0.29.2 Path Traversal via Tar Archive Extraction), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-137507 (entry last updated 2026-11-26):
Affected:
- PyPI package torchvision: fixed in 0.29.2
Fixed versions: 0.29.2.
Conditions (all must be true for the bug to be hit):
- torchvision versions before 0.29.2 (source: https://www.vulncheck.com/advisories/torchvision-before-0.29.2-path-traversal-via-tar-archive-extraction)
- Attacker-controlled archives are passed to extract_archive() or download_and_extract_archive() (source: https://www.vulncheck.com/advisories/torchvision-before-0.29.2-path-traversal-via-tar-archive-extraction)
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
Attacker needs: network access, no login, a user action.
CISA KEV: CVE-2026-137507 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-137507 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Packages (PyPI): find every lockfile in each project and run the stack.check operation of the cve.now MCP server (execute) on each one. Compare the resolved versions, not the ranges a manifest declares, with the affected versions above. Include transitive dependencies.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/pytorch/vision/commit/7a7520f83957fe6a0f934fe7035f07b5ef32e8f9
- https://github.com/pytorch/vision/commit/b22811118b30f18ef02006fc6215a52140fd689f
- https://github.com/pytorch/vision/issues/9517
- https://github.com/pytorch/vision/releases/tag/v0.29.2
- https://github.com/pytorch/vision/blob/v0.29.1/torchvision/datasets/utils.py#L209-L213
- https://www.vulncheck.com/advisories/torchvision-before-0.29.2-path-traversal-via-tar-archive-extraction
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-137507
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-137507"}.Affected versions
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure12/25Specific setups only, reachable over the network without a login
- Reach16/20torchvision: 4.4M downloads a week
- Severity7.1/10CVSS 7.1
- No patch0/5No signal
What would change the score
- Would score about 85 if added to CISA KEV
- Would score about 80 if CISA's SSVC rates exploitation active
Impact
- Widely usedtorchvision has 4.4m weekly downloads. pypistats.org6.6k packages depend on torchvision. deps.dev
Timeline
- CVE published
- First seen by cve.now
Evidence 8
| Kind | Source |
|---|---|
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-137507 |
| Record | NVD · CVE-2026-137507 |
| Other links 6 | |
| Patch | GitHub · pytorch/vision · Commit 7a7520f8 |
| Patch | GitHub · pytorch/vision · Commit b2281111 |
| Report | GitHub · pytorch/vision · Issue #9517 |
| Repository | GitHub · pytorch/vision · Release v0.29.2 |
| Repository | GitHub · pytorch/vision · torchvision/datasets/utils.py · L209-L213 |
| Link | vulncheck.com · advisories/torchvision-before-0.29.2-path-traversal-via-tar-archive-extraction |
Questions about CVE-2026-137507
Is CVE-2026-137507 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
A crafted tar archive can make torchvision write files outside the intended extraction directory. Those files can overwrite Python modules, which can lead to code execution.
Source: vulncheck.com
Which versions are affected by CVE-2026-137507?
torchvision (PyPI): before 0.29.2.
Source: cve.now feed data
Am I affected, and how do I check?
Versions of torchvision before 0.29.2 are affected, in setups where archives are passed to extract_archive() or download_and_extract_archive(). To check a version, run python -c "import torchvision; print(torchvision.__version__)".
Source: vulncheck.com
How do I fix CVE-2026-137507?
Upgrade torchvision to 0.29.2 or later, which contains the fix.
Source: vulncheck.com
Related
- CVE-2026-65918PyTorch torchvision GIF Decoder Out-of-bounds Heap Read
- CVE-2023-43654TorchServe Server-Side Request Forgery
- CVE-2024-35198TorchServe bypass allowed_urls configuration
- CVE-2025-32434PyTorch: `torch.load` with `weights_only=True` leads to remote code execution
- CVE-2026-24747PyTorch Vulnerable to Remote Code Execution via Untrusted Checkpoint Files
- CVE-2024-35199TorchServe gRPC Port Exposure
No corrections so far. Something wrong on this page? Report an error.