ccs received early errors after openssl security update

Bug #1356843 reported by Tim Ritberg on 2014-08-14
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openssl (Ubuntu)
Undecided
Unassigned
Lucid
Undecided
Marc Deslauriers
Precise
Undecided
Unassigned
postfix (Ubuntu)
Undecided
Unassigned
Lucid
Undecided
Unassigned
Precise
Undecided
Marc Deslauriers

Bug Description

SRU request:

[Impact]

The CVE-2014-0224 update for openssl will now reject CCS messages when they are received before encryption is negotiated. This has caused an issue for certain sites attempting to send mail to Ubuntu 12.04 servers running postfix. It turns out there is an incompatibility between postfix in Ubuntu 12.04 and openssl in 12.04 that mishandles session ids. This was fixed in Postfix 2.10.2, and the minimal fix is included in this debdiff.

[Test Case]
Server A = Ubuntu 10.04 with postfix configured to forward mail, ie:

relayhost = server b's FQDN
smtp_tls_security_level = encrypt

Server B = Ubuntu 12.04 with postfix configured to receive mail with forced tls:

smtpd_tls_security_level = encrypt

Send more than one mail from Server A to Server B, and see if the following error appears in mail.log:
warning: TLS library problem: 31807:error:14094085:SSL routines:SSL3_READ_BYTES:ccs received early:s3_pkt.c:1146:

[Regression potential]
This patch disables TLS session tickets, which is what later postfix versions do. If this introduces a regression, it may cause TLS to ether fail completely, or to break when resuming sessions.

Original description:

Postfix is causing a TLS error, when relaying mails with TLS encryption:
warning: TLS library problem: 31807:error:14094085:SSL routines:SSL3_READ_BYTES:ccs received early:s3_pkt.c:1146:

Marc Deslauriers (mdeslaur) wrote :

So from the irc discussion:

two servers, one Ubuntu 10.04, and one Ubuntu 12.04. Both are using postfix. The 12.04 server is running postfix 2.9.6-1~12.04.1.

10.04 is running openssl 0.9.8k-7ubuntu8.20 and 12.04 is running openssl 1.0.1-4ubuntu5.17.

The 10.04 is sending mail to the 12.04 server.

The 10.04 is getting the following in the log:

TLS library problem: 25971:error:14094085:SSL routines:SSL3_READ_BYTES:ccs received early:s3_pkt.c:1146

The 12.04 is getting the following:

lost connection after STARTTLS

Marc Deslauriers (mdeslaur) wrote :

The 10.04 server is running postfix 2.7.0-1ubuntu0.2

Tim Ritberg (xpert-reactos) wrote :

correct so far.

I want to add, when you have configured postfix like this:
smtp_tls_security_level=may

mails will be transported unencrypted.

Marc Deslauriers (mdeslaur) wrote :

I have reproduced this issue. It looks like something may be wrong with openssl in Ubuntu 12.04.

Attached is a packet capture that shows 12.04 sending a CCS before a Server Key Exchange for some reason.

Marc Deslauriers (mdeslaur) wrote :

Actually, I believe I'm reading that wrong, disregard my last comment.

Marc Deslauriers (mdeslaur) wrote :

OK, it turns out there is an incompatibility between the postfix package in precise and the version of openssl in precise.

This was fixed in postfix 2.10.2 by the following change:

20130616

 TLS Performance: the Postfix SMTP server TLS session cache
 was ineffective because recent OpenSSL versions enable
 session tickets by default, resulting in a different ticket
 encryption key for each smtpd(8) process. The workaround
 turns off session tickets. In 2.11 we'll enable session
 tickets properly. Viktor Dukhovni. File: tls/tls_server.c.

This was causing the postfix server to respond in an invalid way, resulting in the openssl security fix to trigger the error.

affects: openssl (Ubuntu) → postfix (Ubuntu)
Changed in postfix (Ubuntu):
status: New → Fix Released
Changed in postfix (Ubuntu Precise):
status: New → Confirmed
Marc Deslauriers (mdeslaur) wrote :
summary: - ccs received early
+ ccs received early errors after openssl security update
Marc Deslauriers (mdeslaur) wrote :

I've uploaded a package for precise-proposed for processing by the SRU team.

description: updated
Changed in postfix (Ubuntu Precise):
status: Confirmed → In Progress
assignee: nobody → Marc Deslauriers (mdeslaur)
description: updated

Hello Tim, or anyone else affected,

Accepted into trusty-proposed. The package will build now and be available in a few hours in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Sven (5-launmhpad-t) wrote :

Postfix does not show up in trusty-proposed.

Tim Ritberg (xpert-reactos) wrote :

Try this, it works for me:

apt-get install postfix/precise-proposed

Sven (5-launmhpad-t) wrote :

That worked and "lost connection after STARTTLS" does not appear any more.

Scott Kitterman (kitterman) wrote :

This issue should not affect trusty as it has the fix from upstream. Did you have the problem/test the fix on trusty or precise?

Tim Ritberg (xpert-reactos) wrote :

Precise

The verification of the Stable Release Update for postfix has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package postfix - 2.9.6-1~12.04.2

---------------
postfix (2.9.6-1~12.04.2) precise; urgency=medium

  * src/tls/tls_server.c: disable session tickets to fix a compatibility
    issue with the openssl version in Ubuntu 12.04. (LP: #1356843)
 -- Marc Deslauriers <email address hidden> Fri, 15 Aug 2014 14:48:13 -0400

Changed in postfix (Ubuntu Precise):
status: In Progress → Fix Released
Marc Deslauriers (mdeslaur) wrote :

There also is an issue with the openssl package in Lucid, which was worked around with the postfix fix.
Adding openssl to this bug since it's better if we fix both.

Changed in openssl (Ubuntu Precise):
status: New → Invalid
Changed in openssl (Ubuntu):
status: New → Invalid
Changed in openssl (Ubuntu Lucid):
status: New → Confirmed
assignee: nobody → Marc Deslauriers (mdeslaur)
Changed in postfix (Ubuntu Lucid):
status: New → Invalid
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openssl - 0.9.8k-7ubuntu8.21

---------------
openssl (0.9.8k-7ubuntu8.21) lucid-security; urgency=medium

  * SECURITY UPDATE: Properly fix stateless session support (LP: #1356843)
    - fixes regression introduced with fix_renegotiation.patch.
    - debian/patches/fix_stateless_session.patch: added two commits from
      git to properly handle stateless sessions in ssl/s3_srvr.c,
      ssl/ssl_asn1.c, ssl/t1_lib.c.
 -- Marc Deslauriers <email address hidden> Mon, 18 Aug 2014 11:17:08 -0400

Changed in openssl (Ubuntu Lucid):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments