[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup -
__init__.py:1.7.2.4 handlers.py:1.6.2.8 zopeschema.xml:1.7.2.10
Tres Seaver
tseaver at zope.com
Thu Jan 8 18:34:36 EST 2004
Update of /cvs-repository/Zope/lib/python/Zope/Startup
In directory cvs.zope.org:/tmp/cvs-serv30073/lib/python/Zope/Startup
Modified Files:
Tag: Zope-2_7-branch
__init__.py handlers.py zopeschema.xml
Log Message:
Merge security audit work for the 2.7 branch:
- Collector #1140: setting the access control implementation from
the configuration file didn't work. The ZOPE_SECURITY_POLICY
environment variable is no longer honored.
- Browsers that do not escape html in query strings such as
Internet Explorer 5.5 could potentially send a script tag in a
query string to the ZSearch interface for cross-site scripting.
- FilteredSets (used within TopicIndex) are defined via an expression,
which was naievely eval'ed.
- The ZTUtils SimpleTree decompressed tree state data from the
request without checking for final size, which could allow for
certain types of DoS attacks.
- Inadequate security assertions on administrative "find" methods
could potentially be abused.
- Some improper security assertions on DTMLDocument objects could
potentially allow access to members that should be protected.
- Class security was not properly intialized for PythonScripts,
potentially allowing access to variables that should be protected.
It turned out that most of the security assertions were in fact
activated as a side effect of other code, but this fix is still
appropriate to ensure that all security declarations are properly
applied.
- The dtml-tree tag used an "eval" of user-supplied data; its
efforts to prevent abuse were ineffective.
- XML-RPC marshalling of class instances used the instance
__dict__ to marshal the object, and could include attributes
prefixed with an underscore name. These attributes are considered
private in Zope and should generally not be disclosed.
- Some property types were stored in a mutable data type (list) which
could potentially allow untrusted code to effect changes on those
properties without going through appropriate security checks in
particular scenarios.
- Inadequate type checking could allow unicode values passed to
RESPONSE.write() to be passed into deeper layers of asyncore,
where an exception would eventually be generated at a level that
would cause the Zserver main loop to terminate.
- The variables bound to page templates and Python scripts such as
"context" and "container" were not checked adequately, allowing
a script to potentially access those objects without ensuring the
necessary permissions on the part of the executing user.
- Iteration over sequences could in some cases fail to check access
to an object obtained from the sequence. Subsequent checks (such
as for attributes access) of such an object would still be
performed, but it should not have been possible to obtain the
object in the first place.
- List and dictionary instance methods such as the get method of
dictionary objects were not security aware and could return an
object without checking access to that object. Subsequent checks
(such as for attributes access) of such an object would still be
performed, but it should not have been possible to obtain the
object in the first place.
- Use of 'import as. in Python scripts could potentially rebind
names in ways that could be used to avoid appropriate security
checks.
- A number of newer built-ins (min, max, enumerate, iter, sum)
were either unavailable in untrusted code or did not perform
adequate security checking.
- Unpacking via function calls, variable assignment, exception
variables and other contexts did not perform adequate security
checks, potentially allowing access to objects that should have
been protected.
- DTMLMethods with proxy rights could incorrectly transfer those
rights via acquisition when traversing to a parent object.
=== Zope/lib/python/Zope/Startup/__init__.py 1.7.2.3 => 1.7.2.4 ===
--- Zope/lib/python/Zope/Startup/__init__.py:1.7.2.3 Thu Oct 2 16:32:53 2003
+++ Zope/lib/python/Zope/Startup/__init__.py Thu Jan 8 18:34:05 2004
@@ -39,6 +39,7 @@
# are set up, we flush accumulated messages in StartupHandler's
# buffers to the real logger.
starter.setupStartupHandler()
+ starter.setupSecurityOptions()
# Start ZServer servers before we drop privileges so we can bind to
# "low" ports:
starter.setupZServerThreads()
@@ -99,6 +100,14 @@
if os.name == 'posix':
from Signals import Signals
Signals.registerZopeSignals()
+
+ def setupSecurityOptions(self):
+ import AccessControl
+ AccessControl.setImplementation(
+ self.cfg.security_policy_implementation)
+ AccessControl.setDefaultBehaviors(
+ not self.cfg.skip_ownership_checking,
+ not self.cfg.skip_authentication_checking)
def setupStartupHandler(self):
# set up our initial logging environment (log everything to stderr
=== Zope/lib/python/Zope/Startup/handlers.py 1.6.2.7 => 1.6.2.8 ===
--- Zope/lib/python/Zope/Startup/handlers.py:1.6.2.7 Sun Dec 21 21:33:42 2003
+++ Zope/lib/python/Zope/Startup/handlers.py Thu Jan 8 18:34:05 2004
@@ -39,14 +39,6 @@
not value and _setenv('ZOPE_DTML_REQUEST_AUTOQUOTE', '0')
return value
-def skip_authentication_checking(value):
- value and _setenv('ZSP_AUTHENTICATED_SKIP', '1')
- return value
-
-def skip_ownership_checking(value):
- value and _setenv('ZSP_OWNEROUS_SKIP', '1')
- return value
-
def maximum_number_of_session_objects(value):
default = 1000
value not in (None, default) and _setenv('ZSESSION_OBJECT_LIMIT', value)
@@ -97,10 +89,6 @@
value and _setenv('REST_OUTPUT_ENCODING' , value)
return value
-def maximum_security_manager_stack_size(value):
- value is not None and _setenv('Z_MAX_STACK_SIZE', value)
- return value
-
def publisher_profile_file(value):
value is not None and _setenv('PROFILE_PUBLISHER', value)
from ZPublisher.Publish import install_profiling
@@ -110,9 +98,6 @@
def http_realm(value):
value is not None and _setenv('Z_REALM', value)
return value
-
-def security_policy_implementation(value):
- value not in ('C', None) and _setenv('ZOPE_SECURITY_POLICY', value)
def max_listen_sockets(value):
import ZServer
=== Zope/lib/python/Zope/Startup/zopeschema.xml 1.7.2.9 => 1.7.2.10 ===
--- Zope/lib/python/Zope/Startup/zopeschema.xml:1.7.2.9 Sun Dec 21 21:33:42 2003
+++ Zope/lib/python/Zope/Startup/zopeschema.xml Thu Jan 8 18:34:05 2004
@@ -448,16 +448,6 @@
<metadefault>unset</metadefault>
</key>
- <key name="maximum-security-manager-stack-size" datatype="integer"
- default="100" handler="maximum_security_manager_stack_size">
- <description>
- This variable allows you to customize the size of the Zope
- SecurityManager stack. You shouldn't change this unless you know what
- it means.
- </description>
- <metadefault>100</metadefault>
- </key>
-
<key name="publisher-profile-file" handler="publisher_profile_file">
<description>
Causing this directive to point to a file on the filesystem will
@@ -529,7 +519,7 @@
<key name="security-policy-implementation"
datatype=".security_policy_implementation"
- default="C" handler="security_policy_implementation">
+ default="C">
<description>
The default Zope "security policy" implementation is written in C.
Set this key to "PYTHON" to use the Python implementation
@@ -540,7 +530,7 @@
</key>
<key name="skip-authentication-checking" datatype="boolean"
- default="off" handler="skip_authentication_checking">
+ default="off">
<description>
Set this directive to 'on' to cause Zope to prevent Zope from
attempting to authenticate users during normal operation.
@@ -551,7 +541,7 @@
</key>
<key name="skip-ownership-checking" datatype="boolean"
- default="off" handler="skip_ownership_checking">
+ default="off">
<description>
Set this directive to 'on' to cause Zope to ignore ownership checking
when attempting to execute "through the web" code. By default, this
More information about the Zope-Checkins
mailing list