[issue15061] hmac.secure_compare() leaks information about length of strings

Jon Oberheide report at bugs.python.org
Sat Jun 16 05:05:32 CEST 2012


Jon Oberheide <jon at oberheide.org> added the comment:

Wow, that escalated quickly. :-)

Nick, thanks for keeping things focused and on track.

To recap, the primary motivation here is two-fold. First, folks are using == pretty frequently in an unsafe manner when comparing digests, signatures, and other fixed-length strings. This is not good. Second, as we've seen in this thread and elsewhere, getting this right is not easy. Which is the exact reason it belongs in python's stdlib, so that folks do not try to implement it themselves incorrectly.

And again, preventing the leakage of the length of the inputs is not an intended goal here for this use case. It'd be best to keep things as simple as possible while achieving the desired security objective.

----------
nosy: +Jon.Oberheide

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15061>
_______________________________________


More information about the Python-bugs-list mailing list