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 1315056 - tls_version macro incorrectly calculated
Summary: tls_version macro incorrectly calculated
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sendmail
Version: 6.5
Hardware: All
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1472763
TreeView+ depends on / blocked
 
Reported: 2016-03-06 10:40 UTC by Ted Rule
Modified: 2017-09-06 09:32 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1472763 (view as bug list)
Environment:
Last Closed: 2017-09-06 09:32:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
sendmail-8.14.4 patch file to correct Sendmail logging of SSL/TLS Protocol (564 bytes, patch)
2017-03-19 02:49 UTC, Chuck Liggett
no flags Details | Diff
Updated Spec File implementing new Sendmail TLS Version Logging Patch (55.30 KB, text/plain)
2017-03-19 02:51 UTC, Chuck Liggett
no flags Details
Backported fix (508 bytes, patch)
2017-07-19 11:25 UTC, Jaroslav Škarvada
no flags Details | Diff

Description Ted Rule 2016-03-06 10:40:35 UTC
Description of problem:

${tls_version} is used in the Received header - supposedly to report the TLS protocol version used by the incoming STARTTLS connection.

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

sendmail-8.14.4-9.el6.x86_64

The issue is that sendmail uses the "wrong" OpenSSL primitive to deduce the version string, i.e. within sendmail/tls.c:

....
	s = SSL_CIPHER_get_version(c);
	if (s == NULL)
              s = "UNKNOWN";
        macdefine(mac, A_TEMP, macid("{tls_version}"), s);
....

where I think it should really be using SSL_get_version() instead. Indeed, the description of ${tls_version} in the Bat Book strongly implies that it expects the string as returned by SSL_get_version().

Hence we just need a repair to one line of code:

....
	s = SSL_get_version(c);
	if (s == NULL)
               s = "UNKNOWN";
        macdefine(mac, A_TEMP, macid("{tls_version}"), s);
....


Obviously, if this change were made, there is the potential for some backwards compatibility issues with any 3rd party scripts which parse the logs, and/or custom /etc/mail/sendmail.cf, /etc/mail/access configurations which assume certain values for ${tls_version}.

On the upside, the improvement in logging clarity makes it easier to deduce the prescence of legacy clients in future - especially once TLSv1.0 is deprecated.



Steps to Reproduce:
1. Initiate connection to STARTTLS capable sendmail Server from TLSv1.2 capable client.
2. Inspect /var/log/maillog logs with LogLevel > 8


Actual results:

SSLv3/TLSv1 within Received header.

Expected results:

TLSv1.2 within Received header.

Additional info:

Inspection of source code indicates that this is also a problem for RHEL7 sendmail 8.14.7


For extra clarity, the relevant man pages in OpenSSL show:

SSL_CIPHER_get_version()

returns string which indicates the SSL/TLS protocol version that first defined the cipher. This is currently SSLv2 or TLSv1/SSLv3. In some cases it should possibly return "TLSv1.2" but does not; use SSL_CIPHER_description() instead. If cipher is NULL, "(NONE)" is returned.


SSL_get_version() returns the name of the protocol used for the connection ssl.

The following strings can be returned:

SSLv2
    The connection uses the SSLv2 protocol.
SSLv3
    The connection uses the SSLv3 protocol.
TLSv1
    The connection uses the TLSv1.0 protocol.
TLSv1.1
    The connection uses the TLSv1.1 protocol.
TLSv1.2
    The connection uses the TLSv1.2 protocol.

unknown
    This indicates that no version has been set (no connection established).

Comment 3 Chuck Liggett 2017-03-19 02:49:55 UTC
Created attachment 1264526 [details]
sendmail-8.14.4 patch file to correct Sendmail logging of SSL/TLS Protocol

Comment 4 Chuck Liggett 2017-03-19 02:51:08 UTC
Created attachment 1264527 [details]
Updated Spec File implementing new Sendmail TLS Version Logging Patch

Comment 5 Chuck Liggett 2017-03-19 02:53:43 UTC
The current TLS Protocol logging in Sendmail is broken, as Ted Rule points out in the description of this bug.

It is important that the actual TLS protocol version be reported instead of an ambiguous "SSLv3/TLSv1", particularly in light of the fact that SSL is no longer considered secure, and TLSv1.0 is on the way out as well, particularly in light of the PCI Council's decision that SSL and TLSv1.0 is no longer acceptable for PCI compliance.

Ted's recommended fix is very close to what needs to be implemented, however he's supplying the structure argument in his example.

The SSL_CIPHER_get_version() function has the following prototype:

     char *SSL_CIPHER_get_version(const SSL_CIPHER *c);

But, the proper replacement function has the following prototype:

     const char *SSL_get_version(const SSL *s);

So, after examining the sendmail/tls.c source code and taking the proper structure arguments into consideration, here is the recommended fix:

....
       s = SSL_CIPHER_get_version(c);
       if (s == NULL)
               s = "UNKNOWN";
       macdefine(mac, A_TEMP, macid("{tls_version}"), s);
....


I have also attached a proposed patch file and updated Spec file for the build.  Tested as an update to sendmail-8.14.4-9.el6_8.1.src.rpm.

I request that serious consideration is given to classifying this patch as an important security fix and that it be included in a future Production 2 Phase Release for Red Hat Enterprise Linux 6.

Comment 6 Chuck Liggett 2017-03-19 02:56:34 UTC
Correction to Comment 5:

The current TLS Protocol logging in Sendmail is broken, as Ted Rule points out in the description of this bug.

It is important that the actual TLS protocol version be reported instead of an ambiguous "SSLv3/TLSv1", particularly in light of the fact that SSL is no longer considered secure, and TLSv1.0 is on the way out as well, particularly in light of the PCI Council's decision that SSL and TLSv1.0 is no longer acceptable for PCI compliance.

Ted's recommended fix is very close to what needs to be implemented, however he's supplying the wrong structure argument in his example.

The SSL_CIPHER_get_version() function has the following prototype:

     char *SSL_CIPHER_get_version(const SSL_CIPHER *c);

But, the proper replacement function has the following prototype:

     const char *SSL_get_version(const SSL *s);

So, after examining the sendmail/tls.c source code and taking the proper structure arguments into consideration, here is the recommended fix:

....
       s = SSL_CIPHER_get_version(ssl);
       if (s == NULL)
               s = "UNKNOWN";
       macdefine(mac, A_TEMP, macid("{tls_version}"), s);
....


I have also attached a proposed patch file and updated Spec file for the build.  Tested as an update to sendmail-8.14.4-9.el6_8.1.src.rpm.

I request that serious consideration is given to classifying this patch as an important security fix and that it be included in a future Production 2 Phase Release for Red Hat Enterprise Linux 6.

Comment 7 Jaroslav Škarvada 2017-07-19 11:25:32 UTC
Created attachment 1300995 [details]
Backported fix

Comment 8 Jaroslav Škarvada 2017-07-19 11:28:39 UTC
Thanks for info. I am afraid it will not classify as a important/security fix for product in production 2 phase, but feel free to escalate this problem through the support channel. I am cloning this bug to RHEL-7.

Comment 9 Tomáš Hozza 2017-09-06 09:32:20 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.