Bug 1382386 - Directory Server accepts a wrong userdn macro ACI
Summary: Directory Server accepts a wrong userdn macro ACI
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: 389-ds-base
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
Marc Muehlfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-06 14:22 UTC by Simon Pichugin
Modified: 2020-09-13 20:17 UTC (History)
3 users (show)

Fixed In Version: 389-ds-base-1.2.11.15-84.el6
Doc Type: Bug Fix
Doc Text:
Directory Server now validates macros in ACIs Previously, the Red Hat Directory Server did not validate macros in an access control instruction (ACI). As a result, users were able to set incorrect macros in an ACI. This update improves the code underlying validation, and Directory Server rejects invalid macros and logs an error.
Clone Of:
Environment:
Last Closed: 2017-03-21 10:23:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 449 0 None None None 2020-09-13 20:17:00 UTC
Red Hat Product Errata RHBA-2017:0667 0 normal SHIPPED_LIVE 389-ds-base bug fix update 2017-03-21 12:35:05 UTC

Description Simon Pichugin 2016-10-06 14:22:17 UTC
Description of problem:
It is possible to add ACI with a wrong userdn macro in it.


Version-Release number of selected component (if applicable):
389-ds-base-1.2.11.15-74.el6.x86_64


How reproducible:
Always


Steps to Reproduce:
1. Install an instance with 'dc=example,dc=com' suffix
2. Add the setup like this:
$ ldapmodify -h localhost -p 389 -D "cn=Directory manager" -w Secret123
dn: o=MACRO.com, dc=example,dc=com
changetype: add
objectClass: top
objectClass: organization
o: MACRO.com
description: ou=Groups
 
adding new entry "o=MACRO.com, dc=example,dc=com"
 
dn: ou=Groups, o=MACRO.com, dc=example,dc=com
changetype: add
objectClass: top
objectClass: organizationalUnit
ou: Groups
 
adding new entry "ou=Groups, o=MACRO.com, dc=example,dc=com"
 
dn: cn=Macro, ou=Groups, o=MACRO.com, dc=example,dc=com
changetype: add
objectClass: top
objectClass: person
cn: Macro
sn: Macro
userPassword: Macro
 
adding new entry "cn=Macro, ou=Groups, o=MACRO.com, dc=example,dc=com"

3. Try to add ACI with a wrong userdn macro in it:
$ ldapmodify -h localhost -p 389 -D "cn=Directory manager" -w Secret123
dn: o=MACRO.com, dc=example,dc=com
changetype: modify
add: aci
aci: (target="ldap:///o=MACRO.com, dc=example,dc=com")(version 3.0; acl "Wrong_ACI_25"; allow (all) userdn="ldap:///cn=Macro, ($attr..description), o=MACRO.com, dc=example,dc=com";)


Actual results:
No error is occured.
modifying entry "o=MACRO.com, dc=example,dc=com"


Expected results:
Invalid syntax error.


Additional info:
It will pass the following macros, but it shouldn't:
- ($attr..description)
- ($attribute.description)
- ($att.$attr.description)
- ($attr#description)

Comment 7 Simon Pichugin 2016-12-01 06:06:44 UTC
Build tested:
389-ds-base-1.2.11.15-85.el6.x86_64

Verification steps:
1. Install an instance with 'dc=example,dc=com' suffix
2. Add the setup like this:
$ ldapmodify -h localhost -p 389 -D "cn=Directory manager" -w Secret123
dn: o=MACRO.com, dc=example,dc=com
changetype: add
objectClass: top
objectClass: organization
o: MACRO.com
description: ou=Groups
 
adding new entry "o=MACRO.com, dc=example,dc=com"
 
dn: ou=Groups, o=MACRO.com, dc=example,dc=com
changetype: add
objectClass: top
objectClass: organizationalUnit
ou: Groups
 
adding new entry "ou=Groups, o=MACRO.com, dc=example,dc=com"
 
dn: cn=Macro, ou=Groups, o=MACRO.com, dc=example,dc=com
changetype: add
objectClass: top
objectClass: person
cn: Macro
sn: Macro
userPassword: Macro
 
adding new entry "cn=Macro, ou=Groups, o=MACRO.com, dc=example,dc=com"

3. Try to add ACI with a wrong userdn macro in it.
Check the following macros, they all should be "Invalid syntax":
- ($attr..description)
- ($attribute.description)
- ($att.$attr.description)
- ($attr#description)

$ ldapmodify -h localhost -p 389 -D "cn=Directory manager" -w Secret123
dn: o=MACRO.com, dc=example,dc=com
changetype: modify
add: aci
aci: (target="ldap:///o=MACRO.com, dc=example,dc=com")(version 3.0; acl "Wrong_ACI_25"; allow (all) userdn="ldap:///cn=Macro, ($attr..description), o=MACRO.com, dc=example,dc=com";)

modifying entry "o=MACRO.com, dc=example,dc=com"
ldap_modify: Invalid syntax (21)
        additional info: ACL Syntax Error(-5):(target=\22ldap:///o=MACRO.com, dc=example,dc=com\22)(version 3.0; acl \22Wrong_ACI_25\22; allow (all) userdn=\22ldap:///cn=Macro, ($attr..description), o=MACRO.com, dc=example,dc=com\22;)

Wrong syntax macros fails. Marking as VERIFIED.

Comment 11 errata-xmlrpc 2017-03-21 10:23:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0667.html


Note You need to log in before you can comment on or make changes to this bug.