carboz Posted February 4, 2016 Report Share Posted February 4, 2016 Recently I stumbled on torrent files that could not be loaded by my µTorrent 3.4.5 (build 41372) giving the error message "Invalid Path in Torrent". Using another client (non-µTorrent) everything went fine. Other people also reported me that they had no problems with these torrents using an older version of µTorrent. Working in IT, I analyzed myself the issue as far as I could. And, according to the torrent specifications I found ( https://wiki.theory.org/BitTorrentSpecification and https://en.wikipedia.org/wiki/Bencode ), this seems to be a bug or misinterpretation by recent versions of µTorrent. The issue is in fact within the "path" specification. Let's take as example the following file path "CD\TitleABC.mp3" for one of the multiple files contained in the torrent (my real case had a longer filename, about 50 characters; for simplicity I took here a shorter example). Normally this file path is represented by two byte strings within a path specification of the torrent file: "CD" (length=2) "TitleABC.mp3" (length=12) Unfortunately, the torrent was created by the uploader several years ago, by a non-µTorrent client, which prefixed the useful path data with an additional zero-length byte string, i.e., using three byte strings instead of two, giving the following suite of characters at the path specification: ….... 4:pathl0:2:CD12:TitleABC.mp3e ….... One could say: It's stupid to add a useless zero-length byte string in front of the path! The "0:" should have been omitted. I agree … but the Bencode specifications says "[…] The length is encoded in base 10, like integers, but must be non-negative (zero is allowed) […]". As zero is allowed, µTorrent should process it correctly, even if the empty string is useless. In the present case it should simply ignore the 2 characters "0:", and not reject the complete path as it does ! Link to comment Share on other sites More sharing options...
DreadWingKnight Posted February 5, 2016 Report Share Posted February 5, 2016 "\\" is the translated path. the rutorrent php library is the only known creator of torrents with null path lengths. The bug is in THEIR code, not uTorrent. The path is disallowed for security reasons. Link to comment Share on other sites More sharing options...
carboz Posted February 5, 2016 Author Report Share Posted February 5, 2016 Thank you. I agree on your explanation indicating that the source of the issue is outside of µTorrent. However, as potentially there is a great number of older torrent files having this unfortunate feature, I would suggest µTorrent to be tolerant with the null length names in the path, like done by earlier versions of µTorrent and by other clients. If there is a security concern, then µTorrent could issue a clear warning message and give the user the choice to either process further (ignoring the null component in the file path), or abort the loading the torrent. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.