On Sun, Jan 26, 2014 at 12:00 PM, Vajrasky Kok <sky.kok at speaklikeaking.com>wrote: > >>> repeat('a', times=-1) > repeat('a') > As I think about it, this may be more than a bug but a door for a denial of service attack. Imagine an application where times comes from an untrusted source. Someone relying on documented behavior may decide to sanitize the value by only checking against an upper bound assuming that negative values would just lead to no repetitions. If an attacker could somehow case times to get the value of -1 this may cause an infinite loop, blow up memory etc. If you think this is far-fetched - consider a web app that uses repeat() as a part of logic to pretty-print user input. The times value may come from a calculation of a difference between the screen width and the length of some string - both under user control. So maybe the fix should go into security bugs only branches as well. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140126/32f52a59/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4