Description
Net::BitTorrent versions before 2.1.0 for Perl write files outside the download directory via path traversal in peer-supplied metadata.

Net::BitTorrent validates file path components only on the .torrent-file ingest path. The peer and magnet metadata path (_on_metadata_received, reached from the BEP09 ut_metadata extension) passes attacker-supplied file names straight to Storage::add_file and Storage::_parse_file_tree, where Path::Tiny's child() does not collapse "..". A v2 file tree key, a v1 files[].path element, or a single-file name containing ".." segments therefore resolves outside the download directory.

Because the peer also controls the piece hashes and the served bytes, content verification passes, so a malicious magnet or peer writes attacker-chosen content to an attacker-chosen path on the downloading host.
Published: 2026-06-30
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Net::BitTorrent versions prior to 2.1.0 allow a peer or magnet link to supply file names that include ".." segments. The library validates path components only when ingesting the .torrent file, but then hands the raw names straight to Storage::add_file and Storage::_parse_file_tree. Path::Tiny's child() does not normalize these segments, so a v2 file‑tree key, a v1 files[]’s path element, or even a single‑file name containing ".." can resolve to a location outside the intended download directory. Because the peer also supplies piece hashes and the data for verification, the integrity check passes, enabling an attacker to write chosen content to an arbitrary path on the host where the client runs.

Affected Systems

The Perl library Net::BitTorrent is affected. All installed instances of versions before 2.1.0 are vulnerable. The flaw resides in the core module that processes metadata (both v1 and v2 torrent formats) and can be triggered by any peer or magnet link that provides malformed metadata.

Risk and Exploitability

A malicious peer or magnet link can exploit this weakness to write arbitrary files to any path reachable by the downloading host. The EPSS score is less than 1% and the vulnerability is not listed in CISA KEV, but the CVSS score of 5.3 indicates moderate risk to confidentiality, integrity, and availability of the system.

Generated by OpenCVE AI on July 31, 2026 at 16:39 UTC.

Remediation

Vendor Solution

Upgrade to version 2.1.0 or later.


OpenCVE Recommended Actions

  • Upgrade to a patched or newer version of Net::BitTorrent once a fix is released; if no release is available, actively monitor the project’s repository for updates or security advisories.
  • Validate all metadata file path components before they are passed to storage – reject empty, ".", "..", or any component containing "/" or "\\" and ensure the resolved path remains inside the download directory.
  • If upgrading is not feasible, replace the vulnerable library with a vetted alternative or apply a local patch that enforces the same validation logic as the workaround.

Generated by OpenCVE AI on July 31, 2026 at 16:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 20 Jul 2026 07:15:00 +0000

Type Values Removed Values Added
Description Net::BitTorrent versions through 2.0.1 for Perl write files outside the download directory via path traversal in peer-supplied metadata. Net::BitTorrent validates file path components only on the .torrent-file ingest path. The peer and magnet metadata path (_on_metadata_received, reached from the BEP09 ut_metadata extension) passes attacker-supplied file names straight to Storage::add_file and Storage::_parse_file_tree, where Path::Tiny's child() does not collapse "..". A v2 file tree key, a v1 files[].path element, or a single-file name containing ".." segments therefore resolves outside the download directory. Because the peer also controls the piece hashes and the served bytes, content verification passes, so a malicious magnet or peer writes attacker-chosen content to an attacker-chosen path on the downloading host. Net::BitTorrent versions before 2.1.0 for Perl write files outside the download directory via path traversal in peer-supplied metadata. Net::BitTorrent validates file path components only on the .torrent-file ingest path. The peer and magnet metadata path (_on_metadata_received, reached from the BEP09 ut_metadata extension) passes attacker-supplied file names straight to Storage::add_file and Storage::_parse_file_tree, where Path::Tiny's child() does not collapse "..". A v2 file tree key, a v1 files[].path element, or a single-file name containing ".." segments therefore resolves outside the download directory. Because the peer also controls the piece hashes and the served bytes, content verification passes, so a malicious magnet or peer writes attacker-chosen content to an attacker-chosen path on the downloading host.
Title Net::BitTorrent versions through 2.0.1 for Perl write files outside the download directory via path traversal in peer-supplied metadata Net::BitTorrent versions before 2.1.0 for Perl write files outside the download directory via path traversal in peer-supplied metadata
References

Wed, 01 Jul 2026 10:30:00 +0000

Type Values Removed Values Added
First Time appeared Sanko
Sanko net::bittorrent
Vendors & Products Sanko
Sanko net::bittorrent

Tue, 30 Jun 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 30 Jun 2026 11:45:00 +0000

Type Values Removed Values Added
Description Net::BitTorrent versions through 2.0.1 for Perl write files outside the download directory via path traversal in peer-supplied metadata. Net::BitTorrent validates file path components only on the .torrent-file ingest path. The peer and magnet metadata path (_on_metadata_received, reached from the BEP09 ut_metadata extension) passes attacker-supplied file names straight to Storage::add_file and Storage::_parse_file_tree, where Path::Tiny's child() does not collapse "..". A v2 file tree key, a v1 files[].path element, or a single-file name containing ".." segments therefore resolves outside the download directory. Because the peer also controls the piece hashes and the served bytes, content verification passes, so a malicious magnet or peer writes attacker-chosen content to an attacker-chosen path on the downloading host.
Title Net::BitTorrent versions through 2.0.1 for Perl write files outside the download directory via path traversal in peer-supplied metadata
Weaknesses CWE-22
References

Subscriptions

Sanko Net::bittorrent
cve-icon MITRE

Status: PUBLISHED

Assigner: CPANSec

Published:

Updated: 2026-07-20T06:42:11.512Z

Reserved: 2026-06-23T18:20:33.513Z

Link: CVE-2026-57079

cve-icon Vulnrichment

Updated: 2026-06-30T13:51:56.088Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T16:45:03Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')