Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Bittorrent v2 (bep 0052) #458

Open
hannob opened this issue Dec 20, 2017 · 34 comments
Open

Support for Bittorrent v2 (bep 0052) #458

hannob opened this issue Dec 20, 2017 · 34 comments

Comments

@hannob
Copy link

hannob commented Dec 20, 2017

I haven't seen any info on whether there's any effort in transmission to support the bittorrent v2 format [1].

Are there any plans or efforts to support it yet? The major reason is the breakage of SHA1, which causes vulnerabilities like the BitErrant attack [2]. The v2 format switches to SHA256 and a Merkle tree structure.

As long as this is unfixed torrents can't be considered as a secure download method that guarantee data integrity.

[1] http://www.bittorrent.org/beps/bep_0052.html
[2] https://biterrant.io/

@lachesis
Copy link

lachesis commented Sep 8, 2020

libtorrent announced BEP-0052 / BitTorrent v2 support today.
https://blog.libtorrent.org/2020/09/bittorrent-v2/

@mikedld mikedld mentioned this issue Sep 8, 2020
@da2x
Copy link

da2x commented Sep 24, 2020

Transmission fails to open torrent files encoded with the v2 reference implementation that contain v1 and v2 data. The libtorrent blog post suggests this torrent should have been compatible with older clients. It works in a lot of other clients. The error message says “invalid or corrupt torrent file.”

@sbrudenell
Copy link

SHA-1 chosen-prefix attacks are now in the USD 10k-100k range. This presents a very real threat, for example against bittorrent-distributed software that might be used by dissidents or whistleblowers.

BitTorrent v2 should be high priority now.

@sbrudenell
Copy link

What will happen if Info Hash is generated in DHT that will be the same for different data, i.e. a SHA1 collision? There were some answers on stackechange, but they were not adequate for me...

BitErrant could be used to initially seed a benign payload, then later switch to a malicious payload. You could either selectively deliver the malicious payload only to chosen targets, or just start delivering it to everyone after some time.

@txtsd
Copy link

txtsd commented Jan 18, 2021

Any updates to this? Can we expect it this year?

@Tykov
Copy link

Tykov commented May 28, 2021

Transmission fails to open torrent files encoded with the v2 reference implementation that contain v1 and v2 data. The libtorrent blog post suggests this torrent should have been compatible with older clients. It works in a lot of other clients. The error message says “invalid or corrupt torrent file.”

At least it should be fixed

@spencermp
Copy link

It would be nice to see this feature implimented, if not for massive levels of current usage then for futureproofing.

@ckerr ckerr changed the title [Feature Request][security] Support for Bittorrent v2 format / BitErrant attack Support for Bittorrent v2 (bep 0052) Jan 26, 2022
@ckerr
Copy link
Member

ckerr commented Jan 31, 2022

#2542 implements part of this by adding support for reading Bittorrent v2 .torrent files. Even after this lands there is still a lot of work to do wrt merkle tree support, but this is at least a step in the right direction.

@ckerr ckerr added this to the 5.0.0-beta.1 milestone Feb 22, 2022
@rustyx
Copy link

rustyx commented Mar 30, 2022

Any news on this? We need v2 reading support asap. Transmission can't open any torrent created by qBittorrent.

@qu1ck
Copy link
Contributor

qu1ck commented Mar 30, 2022

Yeah, at least compatibility with hybrid torrents is crucial. Full v2 support can come later but right now transmission just can't open files.

@qu1ck
Copy link
Contributor

qu1ck commented Apr 10, 2022

Yeah, at least compatibility with hybrid torrents is crucial. Full v2 support can come later but right now transmission just can't open files.

I recompiled from current master (70fbce7) and hybrid files can be opened, thanks.

@Skaronator
Copy link

No, only hybrid torrents that contain v1 and v2 information work on the master branch right now. Transmission will parse the v1 data and will ignore v2 data.

@woojh3690
Copy link

I do not understand why this feature does not have a high priority. In my experience, current half of the torrent is not able to read the transmission.

@lachesis
Copy link

Yeah I am moving away from Transmission because of this missing feature. It's a shame because qBittorrent's CLI and web UI are much worse, and the client runs slower than Transmission on my underpowered seedbox, but there have been several torrents in the last few months that I was simply unable to download with Transmission.

@rebeltaz

This comment was marked as abuse.

@rebeltaz

This comment was marked as off-topic.

@ckerr
Copy link
Member

ckerr commented Apr 22, 2022

I created a hybrid torrent in qBitTorrent and it's still counted as corrupt. Adding using the magnet link just gets stuck in a loop of downloading metadata.

@Zipdox testing with what Transmission build?

If you're still seeing this in a recent build, can you create a hybrid torrent with public domain contents and attach it to this ticket? No need to seed it; I just want to figure out what's not parsing.

@Skaronator
Copy link

bb6b5a0 doesn't include fb39c46 @Zipdox

@kovalensky
Copy link

Is there any bypass for magnet links to work with Transmission?

We are trying to enable BitTorrent v2 support in our torrent tracker, but since Transmission clients having problems we got our hands tied.

@ckerr
Copy link
Member

ckerr commented Jan 5, 2023

@kovalensky depends on what you're asking for:

BitTorrent v2 has the concept of hybrid torrents, where the torrent file & magnet links can have both the sha1 and sha256 info hash. Transmission 4, which is in beta now, supports v2 hybrid torrents and their magnet links.

But Transmission 4 still needs that sha1 hash, so a torrent that is only v2 (i.e. not a hybrid) won't work in Transmission until 5.

@kovalensky
Copy link

@kovalensky depends on what you're asking for:

BitTorrent v2 has the concept of hybrid torrents, where the torrent file & magnet links can have both the sha1 and sha256 info hash. Transmission 4, which is in beta now, supports v2 hybrid torrents and their magnet links.

But Transmission 4 still needs that sha1 hash, so a torrent that is only v2 (i.e. not a hybrid) won't work in Transmission until 5.

We enabled Bittorrent v2 support (15k users) base, but 30% of our good seeding users using Transmission version lesser than 4.
So they are having problems downloading hybrid torrents and magnet links.
We disabled uploading of v2 only torrents, only hybrids and v1 allowed, since that's a great feature to show files' sha2 root hash in torrent's about page.
We don't encourage users to switch to Transmission 4, since it's still in beta.
On the topic of those problems we had to disable hybrid magnet links.
So I was asking if there's a some bypass for this, maybe some additional string in magnet link, idk

@ckerr
Copy link
Member

ckerr commented Jan 5, 2023

Sounds like the solution is to just get 4.0.0 stable out the door

@lvii
Copy link

lvii commented Feb 9, 2023

V2 only torrent is NOT support under 4.0.0 stable now.

Is hybrid torrent download still use V1 ?

img

@ckerr
Copy link
Member

ckerr commented Feb 9, 2023

Looks related to #3386. Very frustrating.

@ckerr ckerr added type:feat A new feature and removed enhancement labels Feb 12, 2023
@s777s
Copy link

s777s commented Feb 13, 2023

In 2023 there is no need for hybrid (using v1 and ignoring v2). V2 only will be enough. Stable 3.0 is in repos of many distros now. Will it be implemented in upcoming 4.0? Why you mark it like "feature"? Client can't open torrent files, it is must urgent Bug! :(
Do you understand, that many users of your software (like me), need to look for another client due to CRITICAL BUG, that has a few years history and this BUG makes client nonworking?

@txtsd
Copy link

txtsd commented Feb 13, 2023

@s777s This kind of tone and approach always wears away at the developers. Please try to be nicer next time despite your frustration 👍

@Nadahar
Copy link

Nadahar commented Feb 13, 2023

@s777s While I too would appreciate v2 support, it's very frivolous to call it a bug. It is not.

To make any software support something, somebody must implement it. I'm sure there's quite a lot of work involved in implementing v2 torrents. So, it all comes down to who has the knowledge, will and opportunity to implement it. I very much doubt labeling something a "bug" and going on a little tantrum will help motivate anybody to find the time and invest the effort needed.

@ckerr
Copy link
Member

ckerr commented Feb 13, 2023

There are a couple of different related / overlapping questions here that I want to answer:

  • The nightly builds used to support reading v2 torrent files but Support for hybrid torrent files (bep 0052) #3386, which fixed an issue in hybrid files, regressed on that. Fixing that regression is something I'm going to investigate for 4.0.x but won't decide until I understand how big / risky / intrusive the change would be.

  • Even if this does get fixed in 4.0.x, things there would work by reading v2 torrent files and using just enough to treat them as v1 torrents. It does not have support for merkle trees, for the new v2 peer protocol messages, or for the v2-style padding. All of that requires new code and by definition cannot go into 4.0.x because Transmission now follows semver (see Request: Start using semantic versioning starting from 4.0 release #1037) and 4.0.x should only fix bugs.

  • Transmission won't go multiple years between releases anymore. For example 4.0.0 has gotten far more feedback than the betas did so I expect there will be a 4.0.1 within a week or two. Even if this stays as-is in 4.0.x that doesn't mean we'll be stuck with the status quo forever.

  • Shouting at me and threatening to take your business elsewhere is not interesting or motivating. If you insist on being a Karen, please do take your business elsewhere because it will make you happier and Transmission's community better.

For everyone who wants these changes to come sooner -- requests are welcomed. That's serious, not snark. The maintainers, including me, have made it a priority to do PR review and help contributors the PRs past the finish line.

@s777s
Copy link

s777s commented Feb 13, 2023

@ckerr to be honest, I appreciate your work and using your client for many years, so I want to say sorry for my tone and thank you for your work. Was a little irritated, because on some trackers there are some seeds (not all) with incompatible newer version. And was a little surprised to see words "vulnerability", "2017" and "feature" in the top of the thread while was googling why torrent file doesn't work.

@zebediah49
Copy link

So, either I'm very confused here, or I guess should file this as a documentation bug. The first entry in the 4.0.0 release's New Features changelog section is

Support for using BitTorrent v2 torrents and hybrid torrents. (Support for creating v2 and hybrid torrents is slated for an upcoming release.)

But this issue seems to be suggesting that it just supports "not breaking", and can't actually use v2 torrents? That seems highly misleading, to the point where I'm not actually sure what the software can do.

@manofsticks
Copy link

manofsticks commented Mar 1, 2023

Reading through this and had some questions. But first the situation to make my questions clearer:

A private tracker I'm on announced they are temporarily restricting Hybrid and V2 torrents, only allowing V1.

Upon creation of a new torrent in Transmission 4.0.1 and uploading it, I received an error on the site.

Downgrading to Transmission 3.0 and creating the torrent worked fine and upload was successful.

I was under the impression from the notes that Transmission 4.0.1 was still creating V1 torrent files, but simply had support for utilizing them? I assume either A) I am creating the torrent incorrectly based on some new setting in 4.0.1, B) The private tracker made a mistake in their Hybrid/V2 bans, or C) I am misunderstanding the situation entirely, as I was not aware there were V1 and V2 torrents until earlier today.

Any clarity appreciated

EDIT: Nevermind, it appears I am entirely wrong on this, and it is unrelated to V1/V2. Per another member on the tracker:

We had that problem on other site and we figured out that when creating .torrent with transmission 4.x it puts announce url into "announce-list" when all other clients (also transmission 3.x) puts it into "announce", so it seems that its just a new bug.

I will try to track down more information on this and put it into the relevant discussion/issue thread.

@hhartzer
Copy link

hhartzer commented Feb 18, 2024

Should this still be open now that v4.0.0 (and later) is out?

It seems like the only piece missing is the ability to create v2 torrents.

Edit: I tried using the v2 only magnet link and .torrent file provided here, with Transmission 4.0.5: https://blog.libtorrent.org/2020/09/bittorrent-v2/

The magnet one gave an error, and the v2 only torrent file didn't throw an error, but didn't add the torrent. I'm not quite sure how v2 is supposed to be working with Transmission v4.

@revher
Copy link

revher commented Feb 28, 2024

Yes, no support yet with the example of https://blog.libtorrent.org/2020/09/bittorrent-v2/
$ transmission-remote -a bittorrent-v2-test.torrent
Error: unrecognized info
with
$ transmission-cli -v
transmission-cli 4.0.5 (a6fe2a64aa)

@revher
Copy link

revher commented Feb 28, 2024

By the way, I compiled Transmission from Git (4.1.0-dev (1855cdb)) successfully on my Monterey 12.6. Bravo! Support for V2 is not here yet. May be it could be added on the Readme.md that there is no support yet because you can google people having run V2 successfully with version 4.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests