<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/libcli/security/access_check.c, branch talloc-2.3.4</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>libcli/security: fix handling of deny type ACEs in access_check_max_allowed()</title>
<updated>2019-03-04T18:11:16+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-03-01T17:57:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8d355dd9769e8990ce998b4c9f28977669b43616'/>
<id>8d355dd9769e8990ce998b4c9f28977669b43616</id>
<content type='text'>
Deny ACEs must always be evaluated against explicitly granted rights
from previous ACEs.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13812

Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Deny ACEs must always be evaluated against explicitly granted rights
from previous ACEs.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13812

Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libcli/security: correct access check and maximum access calculation for Owner Rights ACEs</title>
<updated>2019-03-04T18:11:16+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-03-01T17:20:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=9722f75757c0e38c7f42c7cc310d56aa6eaf6392'/>
<id>9722f75757c0e38c7f42c7cc310d56aa6eaf6392</id>
<content type='text'>
We basically must process the Owner Rights ACEs as any other ACE wrt to the
order of adding granted permissions and checking denied permissions. According
to MS-DTYP 2.5.3.2 Owner Rights ACEs must be evaluated in the main loop over
the ACEs in an ACL and the corresponding access_mask must be directly applied
to bits_remaining. We currently defer this to after the loop over the ACEs in
ACL, this is wrong.

We just have to do some initial magic to determine if an ACL contains and
Owner Rights ACEs, and in case it doesn't we grant SEC_STD_WRITE_DAC |
SEC_STD_READ_CONTROL at the *beginning*. MS-DTYP:

-- the owner of an object is always granted READ_CONTROL and WRITE_DAC.
CALL SidInToken(Token, SecurityDescriptor.Owner, PrincipalSelfSubst)
IF SidInToken returns True THEN
   IF DACL does not contain ACEs from object owner THEN
       Remove READ_CONTROL and WRITE_DAC from RemainingAccess
       Set GrantedAccess to GrantedAccess or READ_CONTROL or WRITE_OWNER
   END IF
END IF

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13812

Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We basically must process the Owner Rights ACEs as any other ACE wrt to the
order of adding granted permissions and checking denied permissions. According
to MS-DTYP 2.5.3.2 Owner Rights ACEs must be evaluated in the main loop over
the ACEs in an ACL and the corresponding access_mask must be directly applied
to bits_remaining. We currently defer this to after the loop over the ACEs in
ACL, this is wrong.

We just have to do some initial magic to determine if an ACL contains and
Owner Rights ACEs, and in case it doesn't we grant SEC_STD_WRITE_DAC |
SEC_STD_READ_CONTROL at the *beginning*. MS-DTYP:

-- the owner of an object is always granted READ_CONTROL and WRITE_DAC.
CALL SidInToken(Token, SecurityDescriptor.Owner, PrincipalSelfSubst)
IF SidInToken returns True THEN
   IF DACL does not contain ACEs from object owner THEN
       Remove READ_CONTROL and WRITE_DAC from RemainingAccess
       Set GrantedAccess to GrantedAccess or READ_CONTROL or WRITE_OWNER
   END IF
END IF

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13812

Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libcli/security: add "Owner Rights" calculation to access_check_max_allowed()</title>
<updated>2019-02-28T19:18:16+00:00</updated>
<author>
<name>Ralph Boehme</name>
<email>slow@samba.org</email>
</author>
<published>2019-02-27T17:07:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=5cf0764bc4b65dbc59d8626760dbe946a2234833'/>
<id>5cf0764bc4b65dbc59d8626760dbe946a2234833</id>
<content type='text'>
This was missing in 44590c1b70c0a24f853c02d5fcdb3c609401e2ca.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13812

Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: David Disseldorp &lt;ddiss@samba.org&gt;

Autobuild-User(master): David Disseldorp &lt;ddiss@samba.org&gt;
Autobuild-Date(master): Thu Feb 28 19:18:16 UTC 2019 on sn-devel-144
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was missing in 44590c1b70c0a24f853c02d5fcdb3c609401e2ca.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13812

Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: David Disseldorp &lt;ddiss@samba.org&gt;

Autobuild-User(master): David Disseldorp &lt;ddiss@samba.org&gt;
Autobuild-Date(master): Thu Feb 28 19:18:16 UTC 2019 on sn-devel-144
</pre>
</div>
</content>
</entry>
<entry>
<title>CVE-2018-10919 security: Fix checking of object-specific CONTROL_ACCESS rights</title>
<updated>2018-08-14T11:57:16+00:00</updated>
<author>
<name>Tim Beale</name>
<email>timbeale@catalyst.net.nz</email>
</author>
<published>2018-07-20T01:01:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=ba46578f97ab35ac12ea0bd298c4180363224675'/>
<id>ba46578f97ab35ac12ea0bd298c4180363224675</id>
<content type='text'>
An 'Object Access Allowed' ACE that assigned 'Control Access' (CR)
rights to a specific attribute would not actually grant access.

What was happening was the remaining_access mask for the object_tree
nodes would be Read Property (RP) + Control Access (CR). The ACE mapped
to the schemaIDGUID for a given attribute, which would end up being a
child node in the tree. So the CR bit was cleared for a child node, but
not the rest of the tree. We would then check the user had the RP access
right, which it did. However, the RP right was cleared for another node
in the tree, which still had the CR bit set in its remaining_access
bitmap, so Samba would not grant access.

Generally, the remaining_access only ever has one bit set, which means
this isn't a problem normally. However, in the Control Access case there
are 2 separate bits being checked, i.e. RP + CR.

One option to fix this problem would be to clear the remaining_access
for the tree instead of just the node. However, the Windows spec is
actually pretty clear on this: if the ACE has a CR right present, then
you can stop any further access checks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13434

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An 'Object Access Allowed' ACE that assigned 'Control Access' (CR)
rights to a specific attribute would not actually grant access.

What was happening was the remaining_access mask for the object_tree
nodes would be Read Property (RP) + Control Access (CR). The ACE mapped
to the schemaIDGUID for a given attribute, which would end up being a
child node in the tree. So the CR bit was cleared for a child node, but
not the rest of the tree. We would then check the user had the RP access
right, which it did. However, the RP right was cleared for another node
in the tree, which still had the CR bit set in its remaining_access
bitmap, so Samba would not grant access.

Generally, the remaining_access only ever has one bit set, which means
this isn't a problem normally. However, in the Control Access case there
are 2 separate bits being checked, i.e. RP + CR.

One option to fix this problem would be to clear the remaining_access
for the tree instead of just the node. However, the Windows spec is
actually pretty clear on this: if the ACE has a CR right present, then
you can stop any further access checks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13434

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>CVE-2018-10919 security: Add more comments to the object-specific access checks</title>
<updated>2018-08-14T11:57:15+00:00</updated>
<author>
<name>Tim Beale</name>
<email>timbeale@catalyst.net.nz</email>
</author>
<published>2018-07-20T01:13:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c107e2d6751b8e6b40f23c50ca4f0e28a0ac9196'/>
<id>c107e2d6751b8e6b40f23c50ca4f0e28a0ac9196</id>
<content type='text'>
Reading the spec and then reading the code makes sense, but we could
comment the code more so it makes sense on its own.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13434

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reading the spec and then reading the code makes sense, but we could
comment the code more so it makes sense on its own.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13434

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>CVE-2018-10919 security: Move object-specific access checks into separate function</title>
<updated>2018-08-14T11:57:15+00:00</updated>
<author>
<name>Tim Beale</name>
<email>timbeale@catalyst.net.nz</email>
</author>
<published>2018-07-19T04:03:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=21d628e045712405663e77e6e01084234df6a99c'/>
<id>21d628e045712405663e77e6e01084234df6a99c</id>
<content type='text'>
Object-specific access checks refer to a specific section of the
MS-ADTS, and the code closely matches the spec. We need to extend this
logic to properly handle the Control-Access Right (CR), so it makes
sense to split the logic out into its own function.

This patch just moves the code, and should not alter the logic (apart
from ading in the boolean grant_access return variable.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13434

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Object-specific access checks refer to a specific section of the
MS-ADTS, and the code closely matches the spec. We need to extend this
logic to properly handle the Control-Access Right (CR), so it makes
sense to split the logic out into its own function.

This patch just moves the code, and should not alter the logic (apart
from ading in the boolean grant_access return variable.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13434

Signed-off-by: Tim Beale &lt;timbeale@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: security: se_access_check() incorrectly processes owner rights (S-1-3-4) DENY ace entries</title>
<updated>2016-12-10T05:24:11+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jra@samba.org</email>
</author>
<published>2016-12-08T18:40:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=29b02cf22f3c0f2d556408e9e768d68c1efc3b96'/>
<id>29b02cf22f3c0f2d556408e9e768d68c1efc3b96</id>
<content type='text'>
Reported and proposed fix by Shilpa K &lt;shilpa.krishnareddy@gmail.com&gt;.

When processing DENY ACE entries for owner rights SIDs (S-1-3-4) the
code OR's in the deny access mask bits without taking into account if
they were being requested in the requested access mask.

E.g. The current logic has:

An ACL containining:

[0] SID: S-1-3-4
    TYPE: DENY
    MASK: WRITE_DATA
[1] SID: S-1-3-4
    TYPE: ALLOW
    MASK: ALLOW_ALL

prohibits an open request by the owner for READ_DATA - even though this
is explicitly allowed.

Furthermore a non-canonical ACL containing:

[0] SID: User SID 1-5-21-something
    TYPE: ALLOW
    MASK: READ_DATA

[1] SID: S-1-3-4
    TYPE: DENY
    MASK: READ_DATA

[2] SID: User SID 1-5-21-something
    TYPE: ALLOW
    MASK: WRITE_DATA

prohibits an open request by the owner for READ_DATA|WRITE_DATA - even
though READ_DATA is explicitly allowed in ACE no 0 and is thus already
filtered out of the "access-still-needed" mask when the deny ACE no 1 is
evaluated.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12466

Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported and proposed fix by Shilpa K &lt;shilpa.krishnareddy@gmail.com&gt;.

When processing DENY ACE entries for owner rights SIDs (S-1-3-4) the
code OR's in the deny access mask bits without taking into account if
they were being requested in the requested access mask.

E.g. The current logic has:

An ACL containining:

[0] SID: S-1-3-4
    TYPE: DENY
    MASK: WRITE_DATA
[1] SID: S-1-3-4
    TYPE: ALLOW
    MASK: ALLOW_ALL

prohibits an open request by the owner for READ_DATA - even though this
is explicitly allowed.

Furthermore a non-canonical ACL containing:

[0] SID: User SID 1-5-21-something
    TYPE: ALLOW
    MASK: READ_DATA

[1] SID: S-1-3-4
    TYPE: DENY
    MASK: READ_DATA

[2] SID: User SID 1-5-21-something
    TYPE: ALLOW
    MASK: WRITE_DATA

prohibits an open request by the owner for READ_DATA|WRITE_DATA - even
though READ_DATA is explicitly allowed in ACE no 0 and is thus already
filtered out of the "access-still-needed" mask when the deny ACE no 1 is
evaluated.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12466

Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;
Signed-off-by: Ralph Boehme &lt;slow@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s4-dsacl: Fixed incorrect handling of privileges in sec_access_check_ds</title>
<updated>2013-10-24T20:45:57+00:00</updated>
<author>
<name>Nadezhda Ivanova</name>
<email>nivanova@symas.com</email>
</author>
<published>2013-10-14T23:06:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=daefca2a1aaa9f4e0ca2f17ef4c9a71412c081ea'/>
<id>daefca2a1aaa9f4e0ca2f17ef4c9a71412c081ea</id>
<content type='text'>
Restore and backup privileges are not relevant to ldap
access checks, and the TakeOwnership privilege should
grant write_owner right

Signed-off-by: Nadezhda Ivanova &lt;nivanova@symas.com&gt;

Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Restore and backup privileges are not relevant to ldap
access checks, and the TakeOwnership privilege should
grant write_owner right

Signed-off-by: Nadezhda Ivanova &lt;nivanova@symas.com&gt;

Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix bug #9674 - Samba denies owner Read Control when there is a DENY entry while W2K08 does not.</title>
<updated>2013-02-23T18:28:15+00:00</updated>
<author>
<name>Richard Sharpe</name>
<email>rsharpe@samba.org</email>
</author>
<published>2013-02-23T16:41:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=3e5acc155bb7be5c531a4a35b16e040f71f628ac'/>
<id>3e5acc155bb7be5c531a4a35b16e040f71f628ac</id>
<content type='text'>
Signed-off-by: Richard Sharpe &lt;rsharpe@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Sat Feb 23 19:28:15 CET 2013 on sn-devel-104
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Richard Sharpe &lt;rsharpe@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Sat Feb 23 19:28:15 CET 2013 on sn-devel-104
</pre>
</div>
</content>
</entry>
<entry>
<title>libcli-acl: add documentation</title>
<updated>2013-01-22T10:14:05+00:00</updated>
<author>
<name>Matthieu Patou</name>
<email>mat@matws.net</email>
</author>
<published>2012-10-14T08:01:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=b1e231384a9245a191ef5e004544d7cafe17e036'/>
<id>b1e231384a9245a191ef5e004544d7cafe17e036</id>
<content type='text'>
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
