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 1091316 - Net::LDAP should not set ciphers to 'ALL' if not requested explicitly
Summary: Net::LDAP should not set ciphers to 'ALL' if not requested explicitly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: perl-LDAP
Version: 7.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Petr Pisar
QA Contact: Jaroslav Aster
URL:
Whiteboard:
Depends On:
Blocks: 1113520
TreeView+ depends on / blocked
 
Reported: 2014-04-25 11:03 UTC by Petr Pisar
Modified: 2018-12-04 17:52 UTC (History)
10 users (show)

Fixed In Version: perl-LDAP-0.56-3.el7
Doc Type: Bug Fix
Doc Text:
Cause: Using Net::LDAPS Perl module to connect to an LDAP server without specifying list of allowed SSL ciphers by `ciphers'. Consequence: The SSL client offers and accepts all SSL ciphers, even that which are not enabled by default by the underlying cryptographic (OpenSSL) library. Fix: Net::LDAP code and documentation have been modified not to request all ciphers by default. Result: Perl LDAP clients will use default OpenSSL cipher list if not specified explicitly otherwise.
Clone Of: 1090966
: 1127322 (view as bug list)
Environment:
Last Closed: 2015-03-05 07:13:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Upstream fix ported to 0.56 (2.09 KB, patch)
2014-08-06 13:50 UTC, Petr Pisar
no flags Details | Diff
Correction for the fix ported to 0.56 (1.16 KB, patch)
2014-08-06 13:56 UTC, Petr Pisar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
CPAN 95001 0 None None None Never
Red Hat Bugzilla 1127322 0 unspecified CLOSED IO::Socket::SSL overrides OpensSSL default cipher list to 'ALL:!LOW' undermining aim for system-wide settings 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2015:0333 0 normal SHIPPED_LIVE perl-LDAP bug fix update 2015-03-05 12:09:20 UTC

Internal Links: 1127322

Description Petr Pisar 2014-04-25 11:03:48 UTC
+++ This bug was initially created as a clone of Bug #1090966 +++

+++ This bug was initially created as a clone of Bug #1044401 +++

Description of problem:
LDAPS connection fails with error: "IO::Socket::SSL: SSL connect attempt failed with unknown errorerror:100AE081:elliptic curve routines:EC_GROUP_new_by_curve_name:unknown group"

Version-Release number of selected component (if applicable):
openssl-1.0.1e-15.el6.x86_64
openssl-1.0.1e-16.el6_5.x86_64

How reproducible:
#!/usr/bin/perl                                                                 

sub ldap_query {
        use Net::LDAPS;

        my $conn = Net::LDAPS->new('ldap.example.com',
                                 version => 3,
                                 port => 636,
                                 capath => '/etc/openldap/cacerts/',
                                 raw => qr/^$/
                               ) || die "$@\n";

        $conn->disconnect();
        return 0;
}

my $test = ldap_query();

Steps to Reproduce:
1. Run above script against suitable ldap-server
2.
3.

Actual results:
IO::Socket::SSL: SSL connect attempt failed with unknown errorerror:100AE081:elliptic curve routines:EC_GROUP_new_by_curve_name:unknown group

Expected results:
Empty output

Additional info:
Downgrade to openssl-1.0.0-27.el6_4.2.x86_64 solves the issue.

[...]
--- Additional comment from Tomas Mraz on 2014-04-24 09:03:10 GMT ---

Now when I finally got a readable packet dump I have to agree that the message the client is sending is incorrect. I really wonder though why the SSLv2 client hello message format is used as the default is set such that OpenSSL uses the SSLv3 client hello format.

Petr, does the perl layer set some non-default SSL cipher list string? The SSLv2 client hello is used because there are SSL2_.... ciphers in the cipher list although they are not supposed to be there unless explicitly configured so by user.

Nevertheless sending the ECC cipher suites in the SSLv2 client hello can be seen as openssl bug as well because there is no way to indicate the supported curve list in the SSLv2 client hello. So this report should be split to two bugs.

--- Additional comment from Petr Pisar on 2014-04-24 12:40:14 GMT ---

There many perl layers above OpenSSL, but the one which changes protocol version and cipher list from the OpenSSL default is Net::LDAP itself (package perl-LDAP).

Net::LDAP sets in case of implicit SSL (ldaps scheme):

  'SSL_version' => 'sslv2/3',
  'SSL_cipher_list' => 'ALL',

while in case of explicit SSL (STARTTLS inside LDAP protocol):

  'SSL_version' => 'tlsv1',
  'SSL_cipher_list' => 'ALL',

This test case is about the first case. And it can be reproduced with openssl(1) tool:

$ openssl s_client -connect 127.0.0.1:2000 -cipher ALL

Please note the current upstream perl-ldap still does that. Except the 'sslv2/3' spelling has been updated to 'sslv23'.

I guess there is no OpenSSL cipher list string for the-default-one, because the perl code looks like:

  SSL_cipher_list     => defined $arg->{ciphers} ? $arg->{ciphers} : 'ALL'

which is the reason why the default Net::LDAPS behavior is enabling all ciphers.

--- Additional comment from Tomas Mraz on 2014-04-24 12:55:23 GMT ---

The SSL_version setting is probably no problem. However the ALL cipher list string really should not be used. Either the cipher list should not be set at all or the 'DEFAULT' string could be used.
-----

I believe not setting SSL_cipher_list if ciphers argument not passed by Net::LDAPS application is the best option.

--- Additional comment from Petr Pisar on 2014-04-24 14:40:58 GMT ---

This fix has been proposed to the perl-ldap upstream.

--- Additional comment from Petr Pisar on 2014-04-25 07:08:43 GMT ---

How to test:

(1) Start an SSL server.
(2) Run a simple Net::LDAPS client without `ciphers' option against the server.
(3) Compare list of ciphers advertised by the client to the server against DEFAULT OpenSSL list (see `openssl ciphers DEFAULT' command output).
Before:
  The lists differ.
After:
  The lists are identical.
-----

perl-LDAP-0.56-2.el7.noarch (with openssl-libs-1.0.1e-34.el7.x86_64) is affected too.

Comment 1 Petr Pisar 2014-06-02 05:35:35 UTC
Patch has been accepted by upstream into perl-ldap-0.63 with commit:

commit 11fe2a9a653ae45ce597e779a44ca42c0b080640
Author: Petr Písař <ppisar>
Date:   Thu Apr 24 15:51:01 2014 +0200

    Do not set SSL_ciphers to ALL by default

Comment 3 Petr Pisar 2014-08-06 13:50:16 UTC
Created attachment 924484 [details]
Upstream fix ported to 0.56

Comment 4 Petr Pisar 2014-08-06 13:56:54 UTC
Created attachment 924493 [details]
Correction for the fix ported to 0.56

Comment 7 Petr Pisar 2014-08-06 16:08:46 UTC
See bug #1090966 for testing instructions.

However please note that current IO::Socket:SSL Perl module (perl-IO-Socket-SSL-1.94-3.el7.noarch) does not respect OpenSSL defaults and overrides it:

        SSL_cipher_list
          If this option is set the cipher list for the connection will be set
          to the given value, e.g. something like 'ALL:!LOW:!EXP:!ADH'. Look
          into the OpenSSL documentation
          (<http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS>) for
          more details.

          If this option is not set 'ALL:!LOW' will be used. To use OpenSSL
          builtin default (whatever this is) set it to ''.

This undermines this perl-Net-LDAP fix and causes sneaking some ciphers into Net::LDAP application:

--- default.sorted      2014-08-06 16:36:58.176000000 +0200
+++ fixed.sorted        2014-08-06 16:35:23.573000000 +0200
@@ -1,3 +1,18 @@
+ADH-AES128-GCM-SHA256
+ADH-AES128-SHA
+ADH-AES128-SHA256
+ADH-AES256-GCM-SHA384
+ADH-AES256-SHA
+ADH-AES256-SHA256
+ADH-CAMELLIA128-SHA
+ADH-CAMELLIA256-SHA
+ADH-DES-CBC3-SHA
+ADH-RC4-MD5
+ADH-SEED-SHA
+AECDH-AES128-SHA
+AECDH-AES256-SHA
+AECDH-DES-CBC3-SHA
+AECDH-RC4-SHA
 AES128-GCM-SHA256
 AES128-SHA
 AES128-SHA256
@@ -59,17 +74,15 @@
 ECDH-RSA-RC4-SHA
 EDH-DSS-DES-CBC3-SHA
 EDH-RSA-DES-CBC3-SHA
+EXP-ADH-DES-CBC-SHA
+EXP-ADH-RC4-MD5
+EXP-DES-CBC-SHA
+EXP-EDH-DSS-DES-CBC-SHA
+EXP-EDH-RSA-DES-CBC-SHA
+EXP-RC2-CBC-MD5
+EXP-RC4-MD5
 IDEA-CBC-SHA
-KRB5-DES-CBC3-MD5
-KRB5-DES-CBC3-SHA
-KRB5-IDEA-CBC-MD5
-KRB5-IDEA-CBC-SHA
-KRB5-RC4-MD5
-KRB5-RC4-SHA
- -3DES-EDE-CBC-SHA
-PSK-AES128-CBC-SHA
-PSK-AES256-CBC-SHA
-PSK-RC4-SHA
 RC4-MD5
 RC4-SHA
 SEED-SHA

The erroneous cipher-suites are the ADH and AECDH and EXP ones. I will report bug against perl-IO-Socket-SSL.

(The KRB5 and PSK ones are not present in the Net::LDAP client because no Kerberos, nor PSK TLS authentication has been available when running the client. These misses are fine.)

Comment 8 Petr Pisar 2014-08-06 16:23:50 UTC
The perl-IO-Socket-SSL issue cloned as bug #1127322.

Comment 11 errata-xmlrpc 2015-03-05 07:13:34 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-2015-0333.html


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