The following code: chars = '23456789' chars = chars + 'ABCDEFGHJKLMNPQRSTUVWXYZ' chars = chars + 'abcdefghijkmnopqrstuvwxyz' chars = list(chars) gives me: File /usr/local/zope/Zope-2.3.1b1-src/lib/python/Products/PythonScripts/Guarded.py, line 189, in __careful_list__ TypeError: cannot convert string to list What could be insecure abotu turning a string into a list of characters?! cheers, Chris
From: "Chris Withers" <chrisw@nipltd.com>
What could be insecure abotu turning a string into a list of characters?!
Gnff. It's like this, see... If you could turn a string into a list, that would give you an easy way to generate really long lists, and then you could loop over the really long list, and burn up memory and CPU time, DOSing yourself. Honest. Yes, I know. It is. All of the machinery that guards against foolish or malicious wasting of CPU and memory should really be optional. There ought to be an environment variable, off by default (everybody out there who lets untrusted users write DTML, raise your hand!), for these particular "security" measures. I'll see what I can do. Cheers, Evan @ digicool
Evan Simpson wrote:
All of the machinery that guards against foolish or malicious wasting of CPU and memory should really be optional.
At last! Someone from DC admits it! ;-)
There ought to be an environment variable, off by default for these particular "security" measures.
Either that or a permission or something, which would be more flexible. Could something similar be added to so something like: 'I trust this user to only import sensible modules' ...so that we don't have to go through pain every time someone needs access to a standard python module (like re for example ;-)
(everybody out there who lets untrusted users write DTML, raise your hand!),
Yeahright! ;-) It does strike me that with a couple more permissions, you could eliminate the need for external methods here... cheers, Chris
From: "Chris Withers" <chrisw@nipltd.com>
There ought to be an environment variable, off by default for these particular "security" measures.
Either that or a permission or something, which would be more flexible. Could something similar be added to so something like: 'I trust this user to only import sensible modules' ...so that we don't have to go through pain every time someone needs access to a standard python module (like re for example ;-)
Yes, it is shame to not have import more accessible in Scripts(Python) PythonMethods has the XXX flag in 'Guarded.py' # BEWARE OF THE LEOPARD! # Set 'do_XXX' true to allow creation of XXXPythonMethods # do_XXX = 0 ..etc.. This seems reasonable if raw to me. One could factor out the XXX flag into a separate External Python Method so advanced users one could more cleanly and finely set conditions for it without disturbing the default installed code. That way people could build permission-oriented DTML or whatever on top of the XXX.py External Method. It's probably way more complicated than this.. just my 0.02 --Jason ___________________________________________________________ Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']
participants (3)
-
Chris Withers -
Evan Simpson -
Jason Cunliffe