Openlib icon indicating copy to clipboard operation
Openlib copied to clipboard

Downloaded files not verified?

Open Vyryn opened this issue 1 year ago • 9 comments
trafficstars

I may be misreading the code, but it doesn't seem like the file contents downloaded from mirrors in lib/services/download_file.dart are verified with the annas-archive md5 hash anywhere. Since third party mirrors can host whatever they like, this is an important step to avoid handing users potential malware. Is it maybe done somewhere I'm not seeing?

Vyryn avatar Feb 01 '24 05:02 Vyryn

I may be misreading the code, but it doesn't seem like the file contents downloaded from mirrors in lib/services/download_file.dart are verified with the annas-archive md5 hash anywhere. Since third party mirrors can host whatever they like, this is an important step to avoid handing users potential malware. Is it maybe done somewhere I'm not seeing?

I'm sorry I haven't implemented that check ,But will sure implement the md5 hash check ASAP. Thank you for mentioning this bro

dstark5 avatar Feb 01 '24 06:02 dstark5

I think maybe it would be good to also show it in the ui?

inson1 avatar Feb 02 '24 00:02 inson1

Sure, gonna add the md5 verified tick after file download on the pop up

dstark5 avatar Feb 02 '24 05:02 dstark5

it looks like its done in latest release

inson1 avatar Feb 06 '24 10:02 inson1

btw if the checksum is wrong, the file is deleted?

inson1 avatar Feb 06 '24 10:02 inson1

If the checksum doesn't match a pop immediately shows with a warning

"The downloaded book may be malicious. Delete it and get the same book from another source, or use the book at your own risk."

dstark5 avatar Feb 06 '24 12:02 dstark5

@dstark5 Shouldnt there be also option to delete the file from the dialog? so its easy to manage it?

inson1 avatar Feb 06 '24 20:02 inson1

Yes there should be but I haven't added the delete button on the alert pop up will sure add it in next update

dstark5 avatar Feb 07 '24 07:02 dstark5

great work

inson1 avatar Feb 07 '24 07:02 inson1