Re: [Zope] Nasty subtle security bug - Me Too

2000-09-26 Thread Martijn Faassen

Shane Hathaway wrote:
 Martijn Faassen wrote:
  General problem description:
  
For a ZClass instance/external methods that is only viewable by
users with a particular role, the view operation fails if that role
is only added to a user in a place deeper in the folder tree than the
folder where the External Method/ZClass instance was defined. This
occurs when the 'view' is occuring in the acquisition context of the
folder.
  
It succeeds if the role is added to the user in a folder higher in the
tree, at or above the folder where the external method or ZClass instance
is defined.
 
 This sounds 100% correct.  When checking security, acquisition context
 is ignored.  What matters is *containment* (which is also accessed
 through the acquisition machinery, but in a special way: aq_inner).  A
 user can only access objects that are defined in a container where the
 user is granted access.

How come it does work with DTML methods then?

I can access a DTML method 'foo' defined in the root folder that is
only accessible with role A, even if role A is only added to me in
a subfolder (from this subfolder).

 You probably don't really want to change it to use context instead.  It
 would open a mile-wide security hole.

Depends on how you reason. I was reasoning context based -- I should
be able to execute something in the context of the current folder, if
I have the right role to do it. That's exactly how it works with DTML methods,
so I didn't expect external methods to be different.

If you're opening a mile-wide security hole with external methods, then
why not with DTML methods?

The view operation fails with a reauthentication request in Zope 2.1.6
(so authentication exception raised presumably).
  
In Zope 2.2.2 the failure is a NameError for External Methods, and
reauthentication for ZClass instances.
  
  Am I missing something terribly obvious, or is this a rather huge bug
  that's been unnoticed for a long time? I assume it *must* be a bug as
  DTML methods behave in a different way. I also want it to be a bug, as
  I don't like this behavior. It makes it very hard to delegate
  responsibility.
 
 The difference is a result of the change in the way security is
 handled.  It now gets a NameError because the name lookups skip over
 entries to which you're disallowed access.  That logic can be very
 puzzling, but you might try the ZDebug product which helps you make
 sense of it.

Okay, I'll try that.

I still don't see why DTML methods are different. Could you explain that?
That's what initially caused much of my confusion; the DTML methods
behave as expected, but call external methods that *don't*, which have
*exactly* the same security settings.

Note that this policy does make acquisition rather useless for delegating
of responsibility, unless you're either using DTML only, or are coding for
anonymous only.

Regards,

Martijn


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Nasty subtle security bug - Me Too

2000-09-25 Thread Brad Clements

On 25 Sep 2000, at 21:01, Martijn Faassen wrote:

 In Zope 2.2.2, the user cannot execute the external method E either.
 Instead, the calling DTML code raises a NameError, basically saying our
 external method does not exist.

 I'll also dump this description into the collector, but posted to the
 list because I like to complain. And who knows, perhaps someone else
 ran into the same.

I also get the same problem in a different way. I posted a note the other 
day about Login Manager and ownership generating NameError.

I thought it was a Login Manager thing. The results are about the same, 
I get a NameError accessing an External method from a DTML method 
when the current user has been authenticated using a Login manager 
protectec sub folder of the root.

My fix, strangely enough, was to change the ownershipp of the DTML 
method that was making the call to the External Method. It was owned 
(somehow) by a user from Login Manager, rather than from the root 
acl_users folder.

Changing the ownership fixed the problem.

I didn't know who should look into this, Ty or DC, so I posted to the list. 
Unfortunately it looks like no one has responded. I don't have the brains 
to figure it out.




Brad Clements,[EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com  (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com   AOL-IM: BKClements

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Nasty subtle security bug - Me Too

2000-09-25 Thread Martijn Faassen

Brad Clements wrote:
 On 25 Sep 2000, at 21:01, Martijn Faassen wrote:
 
  In Zope 2.2.2, the user cannot execute the external method E either.
  Instead, the calling DTML code raises a NameError, basically saying our
  external method does not exist.
 
  I'll also dump this description into the collector, but posted to the
  list because I like to complain. And who knows, perhaps someone else
  ran into the same.
 
 I also get the same problem in a different way. I posted a note the other 
 day about Login Manager and ownership generating NameError.
 
 I thought it was a Login Manager thing. The results are about the same, 
 I get a NameError accessing an External method from a DTML method 
 when the current user has been authenticated using a Login manager 
 protectec sub folder of the root.

This was just plain vanilla user folder. I also get it with ZClass
instances, though I get a reauthentication request (impossible one) in that
case. In  2.1.6, I'd get reauthentication requests for both external
methods and ZClass instances.

 My fix, strangely enough, was to change the ownershipp of the DTML 
 method that was making the call to the External Method. It was owned 
 (somehow) by a user from Login Manager, rather than from the root 
 acl_users folder.
 
 Changing the ownership fixed the problem.

I don't see how to accomplish this in my page. The root folder isn't
owned by anyone, and I can't change it to be owned, I think. The
external methods are all owned by my manager user, can I can't seem
to change that either.

 I didn't know who should look into this, Ty or DC, so I posted to the list. 
 Unfortunately it looks like no one has responded. I don't have the brains 
 to figure it out.

If it is indeed the same problem, it seems to be a Zope core bug.

In fact I misreported that moving the external method to a subfolder
solved all problems -- it still fails (at least in 2.2.2, perhaps it worked
in 2.1.6), as long as the local role needed to execute it is added to the
user in a subfolder below it). If the role is added in the same folder or
a folder above the definition of the external method, it works.

Regards,

Martijn


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )