I have read about BitTorrent protocols and how uTorrent works specifically. The main idea is that instead of many clients accessing the same server for downloading a file, different parts of the file are given to the clients, and then it is shared among the peers (peer to peer). Therefore, improving efficiency and download speed by decreasing the overload on the server.

What if we look at it a little bit differently. We do take advantage of more commputers, but, those machines also gain others' trust. Unlike a sole legitimate server, malicious users can join a p2p download session and share fake info instead of the real content of a file.

For example, consider the following. Two users (user1, user2) are trying to download a jpg image. Each of these users is responsible for sharing their part of the image to the other peers (in this case only one). The public server is responsible for 1/3, user1 is responsible for 1/3 and user2 is responsible for 1/3. What happens if user2 decides to forward fake data to user1? Theoretically, it can control 1/3 of user1's image.

This example can be used with any other file format (exe, libraries, or any other files which can theoretically lead to remote code execution).

I know, it is possible to detect this by comparing the file signatures with the original server. However, do BitTorrents protocols do this? Is this technique even possible at all?

1 Answer 1


Is this technique even possible at all?

No, it's not possible. You are missing a key part of the process, the .torrent file. And the original server does not exist.

That file specifies the filename, the size, how many chunks the file have, and the hash of each one. And that is not attacker-controlled.

When your BitTorrent client wants to download something, it starts with the .torrent file. It will look at the file, and connect to a tracker. The tracker is a server that does not host any file, but instead hosts a list of all pieces he sees and who have which piece. Your client look at the pieces he needs and ask the tracker for people that have that piece.

Now your client will connect to someone (called a peer), and ask a piece of the file (usually the piece which less people have). If the attacker changed the piece to a malicious one, your client will finish downloading, and hash the piece, only to discover it does not match the hash on the .torrent file. It will mark the piece as corrupted and download again, probably from another peer.

  • @Daniel Bartov - It might be worth emphasizing that this does not mean that all torrents are safe. The original torrent creator may have posted a malicious file which other torrent clients propagate. Malicious torrents do exist. Commented Mar 17, 2021 at 20:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .