Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Improve deal with embedded NULLs better, and use the text versions of attribute values in rlm_ldap.
Version-Release number of selected component (if applicable):
freeradius-3.0.4-6.el7
How reproducible:
Steps to Reproduce:
1.setup radiusd with rlm_ldap
2. # allow reply message from ldap
sed -i '/update {/,/}/ s/^#\([[:space:]]*reply:Reply-Message\)/\1/' /etc/raddb/mods-available/ldap
3.Store following entry to ldap
dn: uid=nulltestuser6,dc=example,dc=com
cn: nulltestuser6
objectClass: top
objectClass: radiusObjectProfile
objectClass: radiusprofile
uid: nulltestuser6
userPassword: {SSHA}op2zlZmLW5uX3549vmuemfMOTUQ6IHIy
radiusReplyMessage:: cmVwbHkgd2l0aCBhAGI=
#nulltestuser6 - radiusReplyMessage:: cmVwbHkgd2l0aCBhAGI= (base64 encoded 'reply with a\0b'), e.g. printf 'reply with a\0b' | base64
4. radtest nulltestuser6 redhat localhost 0 testing123
5. Check reply-message
Actual results:
Sending Access-Request Id 62 from 0.0.0.0:50840 to 127.0.0.1:1812
User-Name = 'nulltestuser6'
User-Password = 'redhat'
NAS-IP-Address = 10.34.59.91
NAS-Port = 0
Message-Authenticator = 0x00
Received Access-Accept Id 62 from 127.0.0.1:1812 to 127.0.0.1:50840 length 34
Reply-Message = 'reply with a'
Expected results:
Sending Access-Request Id 62 from 0.0.0.0:50840 to 127.0.0.1:1812
User-Name = 'nulltestuser6'
User-Password = 'redhat'
NAS-IP-Address = 10.34.59.91
NAS-Port = 0
Message-Authenticator = 0x00
Received Access-Accept Id 62 from 127.0.0.1:1812 to 127.0.0.1:50840 length 34
Reply-Message = 'reply with a\\0b'
Additional info:
Comment 9Nikolai Kondrashov
2017-03-24 09:17:15 UTC
The response from upstream was that zero (or NULL) characters are not expected to be handled in LDAP attribute values. Instead, if you want to have zero character in e.g. your Reply-Message, you should have it escaped in the LDAP attribute. I.e. have it set to "reply with a\0b".
Jaroslav, could you please check if that works? Thank you.
Hi Nikolai,
I realized, my test was wrong, not freeradius. Test checked bad value in the test. Freeradius returns "reply with a\000b" and test checks "reply with a\0b", but it is the same.
# echo -en "reply with a\000b" | base64
cmVwbHkgd2l0aCBhAGI=
#printf "reply with a\000b" | base64
cmVwbHkgd2l0aCBhAGI=
#printf "reply with a\0b" | base64
cmVwbHkgd2l0aCBhAGI=
Comment 11Nikolai Kondrashov
2017-03-28 13:29:48 UTC
I see. Could you check that if LDAP attribute contains exactly "reply with a\0b", then the FreeRADIUS response contains the zero character?
LDAP atributes contains this 'cmVwbHkgd2l0aCBhAGI=', which is output of the command printf 'reply with a\0b' | base 64. Freeradius returns 'reply with a\000b', which is the same.
Wireshark shows the same. In 3.0.13, last 3 bytes are 61 00 62. In 3.0.4, last byte is 61, rest is truncated. So you can see zero byte in new version. Pcap files are attached.
Based on that, it seems to be fixed in new version.
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://access.redhat.com/errata/RHEA-2017:1954
Description of problem: Improve deal with embedded NULLs better, and use the text versions of attribute values in rlm_ldap. Version-Release number of selected component (if applicable): freeradius-3.0.4-6.el7 How reproducible: Steps to Reproduce: 1.setup radiusd with rlm_ldap 2. # allow reply message from ldap sed -i '/update {/,/}/ s/^#\([[:space:]]*reply:Reply-Message\)/\1/' /etc/raddb/mods-available/ldap 3.Store following entry to ldap dn: uid=nulltestuser6,dc=example,dc=com cn: nulltestuser6 objectClass: top objectClass: radiusObjectProfile objectClass: radiusprofile uid: nulltestuser6 userPassword: {SSHA}op2zlZmLW5uX3549vmuemfMOTUQ6IHIy radiusReplyMessage:: cmVwbHkgd2l0aCBhAGI= #nulltestuser6 - radiusReplyMessage:: cmVwbHkgd2l0aCBhAGI= (base64 encoded 'reply with a\0b'), e.g. printf 'reply with a\0b' | base64 4. radtest nulltestuser6 redhat localhost 0 testing123 5. Check reply-message Actual results: Sending Access-Request Id 62 from 0.0.0.0:50840 to 127.0.0.1:1812 User-Name = 'nulltestuser6' User-Password = 'redhat' NAS-IP-Address = 10.34.59.91 NAS-Port = 0 Message-Authenticator = 0x00 Received Access-Accept Id 62 from 127.0.0.1:1812 to 127.0.0.1:50840 length 34 Reply-Message = 'reply with a' Expected results: Sending Access-Request Id 62 from 0.0.0.0:50840 to 127.0.0.1:1812 User-Name = 'nulltestuser6' User-Password = 'redhat' NAS-IP-Address = 10.34.59.91 NAS-Port = 0 Message-Authenticator = 0x00 Received Access-Accept Id 62 from 127.0.0.1:1812 to 127.0.0.1:50840 length 34 Reply-Message = 'reply with a\\0b' Additional info: