Strings/numbers distinction fix (following JSON::PP)#5
Strings/numbers distinction fix (following JSON::PP)#5
Conversation
|
Hi, thank you for the kind words and thank you very much for the patch. The approach makes sense to me and consolidating on how other modules do this is useful, so this will be going in in some form. I appreciate you taking the time to submit this upstream. I see the details differently though:
No matter where I differ though, I’m happy you brought this to my attention, so thank you for that and for taking the time to do so. |
Dear Aristotle,
First of all, thanks a lot for bringing this software to public.
Recently, we've run into an issue in one of our customer's production environment causing qBittorrent to fail with
invalid 'name' of torrent (possible exploit attempt)whenever a torrent generated by our CMS is getting added. After investigating for a while, it was found out that this only happens for torrents containing files with as least one path component looking like a number (e.g. year) due to an implicit conversion to i causing qBittorrent to confuse.In it's turn, this led me to the following notice in Bencode docs:
Actually, it is not true that strings and numbers are practically indistinguishable in Perl - although it's correct that it is not somewhat normally needed unless for someone trying to build up a serializer for a format sensitive to that.
So, please let me share a simple yet effective solution found in JSON::PP source code with you. We're already using it in production in order to avoid this problem.
The drawback of this approach which may make you potentially reluctant to approve this PR is that in this way, we have to remove use warnings; to avoid unnecessary warnings in runtime. Although personally I find that a small sacrifice. In any way, I'm always open to discussion.
Best Regards,
Valentin