Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19005
| References | <4f1107b7$0$29988$c3e8da3$5496439d@news.astraweb.com> <mailman.4756.1326587769.27778.python-list@python.org> <994ca5fa-59b0-4128-8f9a-696d46db6856@4g2000pbz.googlegroups.com> |
|---|---|
| Date | 2012-01-15 23:21 +1100 |
| Subject | Re: Hash stability |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4768.1326630087.27778.python-list@python.org> (permalink) |
On Sun, Jan 15, 2012 at 11:03 PM, Bryan <bryanjugglercryptographer@yahoo.com> wrote: > Chris Angelico wrote: >> Suggestion: Create a subclass of dict, the SecureDict or something, >> ... there's no point adding extra load to every >> name lookup just because of a security issue in an extremely narrow >> situation. > > That seemingly "extremely narrow situation" turns out to be wide as > Montana. Maybe Siberia. Does your program take input? Does it accept a > format that could possibly be downloaded from a malicious site on the > Internet? Does your market include users who occasionally make > mistakes? If not, enjoy your utter irrelevance. If so, > congratulations: you write Internet software. Yes, but in that "Internet software", there will only be a small number of dictionaries that an attacker can stuff with keys (GET/POST data, headers, cookies, etc, and anything derived therefrom); compare the huge number of dictionaries that exist elsewhere in your Python program. Adding load to dictionaries will add load to a huge number of lookups that can never come under attack. However, since posting that I've read the entire thread on the python-dev archive. (It is, I might mention, a LOT of text.) A number of suggestions and arguments are put forth, including a subclassing notion similar to my postulation, and the same point is raised: that app/framework developers won't secure their apps. Other options are also offered (personally, I'm liking the one where an exception is raised if something collides with too many keys - current suggestion 1000, although it could possibly work well with something that scales with the dictionary size), and I'm sure that something will be done that's a lot smarter than one quick idea spun off in response to a separate query. So, I retract this idea :) ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Hash stability Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-14 04:42 +0000
Re: Hash stability Peter Otten <__peter__@web.de> - 2012-01-14 10:46 +0100
Re: Hash stability Heiko Wundram <modelnine@modelnine.org> - 2012-01-14 23:45 +0100
Re: Hash stability Chris Angelico <rosuav@gmail.com> - 2012-01-15 11:36 +1100
Re: Hash stability Bryan <bryanjugglercryptographer@yahoo.com> - 2012-01-15 04:03 -0800
Re: Hash stability Chris Angelico <rosuav@gmail.com> - 2012-01-15 23:21 +1100
Re: Hash stability Roy Smith <roy@panix.com> - 2012-01-14 21:26 -0500
Re: Hash stability Terry Reedy <tjreedy@udel.edu> - 2012-01-14 23:07 -0500
Re: Hash stability Stefan Behnel <stefan_ml@behnel.de> - 2012-01-15 11:13 +0100
Re: Hash stability Heiko Wundram <modelnine@modelnine.org> - 2012-01-15 12:46 +0100
Re: Hash stability Peter Otten <__peter__@web.de> - 2012-01-15 13:22 +0100
Re: Hash stability Heiko Wundram <modelnine@modelnine.org> - 2012-01-15 17:07 +0100
Re: Hash stability Chris Angelico <rosuav@gmail.com> - 2012-01-16 03:13 +1100
Re: Hash stability Heiko Wundram <modelnine@modelnine.org> - 2012-01-15 17:51 +0100
Re: Hash stability Stefan Behnel <stefan_ml@behnel.de> - 2012-01-15 18:20 +0100
Re: Hash stability Peter Otten <__peter__@web.de> - 2012-01-16 09:18 +0100
Re: Hash stability Christian Heimes <lists@cheimes.de> - 2012-01-16 09:44 +0100
Re: Hash stability Heiko Wundram <modelnine@modelnine.org> - 2012-01-16 10:15 +0100
csiph-web