You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code snippets wrongly succeed. It looks like some bounds are not checked when they should be, resulting in unintentional memory access.
create_torrent.set_hash() with a short buffer. This succeeds, and create_torrent.generate() shows the piece gets set to be the short buffer plus some garbage data:
fs=file_storage()
fs.add_file("test.txt", 1024)
ct=create_torrent(fs)
ct.set_hash(0, b"a") # should raise ValueError
create_torrent.set_file_hash(), similarly:
fs=file_storage()
fs.add_file("test.txt", 1024)
ct=create_torrent(fs)
ct.set_file_hash(0, b"a") # should raise ValueError
sha1_hash(), similarly:
sha1_hash(b"a") # should raise ValueError
torrent_info.hash_for_piece() with an invalid index wrongly succeeds. This seems to read arbitrary memory...
The following code snippets wrongly succeed. It looks like some bounds are not checked when they should be, resulting in unintentional memory access.
create_torrent.set_hash()
with a short buffer. This succeeds, andcreate_torrent.generate()
shows the piece gets set to be the short buffer plus some garbage data:create_torrent.set_file_hash()
, similarly:sha1_hash()
, similarly:torrent_info.hash_for_piece()
with an invalid index wrongly succeeds. This seems to read arbitrary memory...session.dht_put_mutable_item(b"short", b"short", b"data", b"salt")
: Should raiseValueError
if public or private key arguments are the wrong lengthsession.dht_get_mutable_item(b"short", b"salt")
: Should raiseValueError
if public key argument is wrong lengthI'm finished writing new unit tests and won't add any more items to this issue.
The text was updated successfully, but these errors were encountered: