-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleSecurityInfo('os').declarePublic('environ') allows os.system #12
Comments
Thank you for the report! I believe your analysis is correct, and that acquiring |
Hi, I'll will apply your proposed change also to my Zope instance and let you know if something breaks. |
After checking: Setting |
'SecurityInfo._ModuleSecurityInfo' should not grant or deny access based on the presence / value of an 'access' attribute in the wrapped module. Closes #12.
via e47723e |
as mentioned above I have the following line in one of my zope Products.
Unfortunately in a PythonScript inside Zope, which should run under restricted python, I write code like this without getting an Unauthorized exception. Instead the os.system is happily executed, giving a lot of 'fun' to the users of my system :)
I looked a bit through the code and the following function in SecurityInfo.py got my attention.
The interesting line is
getattr(self, 'access', 0)
. Somehow self takes part in acquisition with the os module as parent.So, self having no attribute 'access', Acquisition jumps back to the os module which has an attribute being os.access
Access control evaluates os.access as True which means 'system' is allowed.
I don't have a big clue how AccessControl works, so its hard for me to say what is the 'appropriate' fix for this. Right now I changed the the
__call__
method to this:The text was updated successfully, but these errors were encountered: