RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1227761 - Postmap LDAP authentication failure fallback to anonymous
Summary: Postmap LDAP authentication failure fallback to anonymous
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: postfix
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-03 12:48 UTC by Sebastien Wains
Modified: 2017-10-27 15:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-27 15:06:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
upstream patch (814 bytes, patch)
2016-09-13 14:22 UTC, Ondřej Lysoněk
no flags Details | Diff

Description Sebastien Wains 2015-06-03 12:48:47 UTC
Description of problem:

When trying to query LDAP with an incorrect password (on purpose), it fallbacks to anonymous instead of returning a failed authentication.

Configuration:

server_host = 172.24.1.230
search_base = ou=COMPANY,ou=populations,o=Developpement
query_filter = (&(mail=%s))
result_attribute = mailstop
result_format = %U@%s.%D
bind = yes
bind_dn = cn=MXsrvCheck,ou=TechObjects,o=SYSTEM
bind_pw = wrong
version = 3


# postmap -v -q john.doe ldap://etc/postfix/ldap-authfail.cf

postmap: dict_open: ldap://etc/postfix/ldap-authfail.cf
postmap: dict_ldap_lookup: In dict_ldap_lookup
postmap: dict_ldap_lookup: No existing connection for LDAP source //etc/postfix/ldap-authfail.cf, reopening
postmap: dict_ldap_connect: Connecting to server ldap://172.24.1.230:389
postmap: dict_ldap_connect: Actual Protocol version used is 3.
postmap: dict_ldap_connect: Binding to server ldap://172.24.1.230:389 as dn cn=MXsrvCheck,ou=TechObjects,o=SYSTEM
postmap: dict_ldap_connect: Successful bind to server ldap://172.24.1.230:389 as cn=MXsrvCheck,ou=TechObjects,o=SYSTEM 
postmap: dict_ldap_connect: Cached connection handle for LDAP source //etc/postfix/ldap-authfail.cf
postmap: dict_ldap_lookup: //etc/postfix/ldap-authfail.cf: Searching with filter (&(mail=john.doe))
postmap: dict_ldap_get_values[1]: Search found 0 match(es)
postmap: dict_ldap_get_values[1]: Leaving dict_ldap_get_values
postmap: dict_ldap_lookup: Search returned nothing
postmap: dict_ldap_close: Closed connection handle for LDAP source //etc/postfix/ldap-authfail.cf



When upgrading to Postfix 2.10 (with postfix.org RPM), the behavior is different and what is actually expected.

postmap: dict_open: ldap://etc/postfix/ldap-authfail.cf
postmap: dict_ldap_lookup: In dict_ldap_lookup
postmap: dict_ldap_lookup: No existing connection for LDAP source //etc/postfix/ldap-authfail.cf, reopening
postmap: dict_ldap_connect: Connecting to server ldap://172.24.1.230:389
postmap: dict_ldap_connect: Actual Protocol version used is 3.
postmap: dict_ldap_connect: Binding to server ldap://172.24.1.230:389 with dn cn=MXsrvCheck,ou=TechObjects,o=SYSTEM
postmap: warning: dict_ldap_connect: Unable to bind to server ldap://172.24.1.230:389 with dn cn=MXsrvCheck,ou=TechObjects,o=SYSTEM: 49 (Invalid credentials)
postmap: fatal: table ldap://etc/postfix/ldap-authfail.cf: query error: Success



Version-Release number of selected component (if applicable):

2.6.6 not working
2.10.2 tested and working


How reproducible:

Always



Steps to Reproduce:
1. Have an LDAP allowing anonymous bind
2. set bind_pw to an incorrect value
3. postmap -q john.doe ldap://etc/postfix/ldap.cf


Actual results:

With an incorrect password, postmap returns 0 matches (in my test it should return 2 matches) because it fallbacks to anonymous, which doesn't have a view on the attribute I'm querying.

In that context, a failure to authenticate would have an impact on routing decisions.


Expected results:

It should return "Invalid credentials"

Additional info:

Comment 4 Ondřej Lysoněk 2016-09-13 14:22:49 UTC
Created attachment 1200520 [details]
upstream patch

Attaching patch taken from upstream.

Comment 6 Tomáš Hozza 2017-10-27 15:06:50 UTC
Red Hat Enterprise Linux 6 transitioned to the Production 3 Phase on May 10, 2017.  During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:
http://redhat.com/rhel/lifecycle

This issue does not appear to meet the inclusion criteria for the Production Phase 3 and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification.  Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com


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