Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 699414 - net-mail/sendmail: sendmail-8.15.2-openssl-1.1.0-fix.patch prevents STARTTLS from working
Summary: net-mail/sendmail: sendmail-8.15.2-openssl-1.1.0-fix.patch prevents STARTTLS ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-06 05:42 UTC by Seth Robertson
Modified: 2021-08-27 21:34 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Seth Robertson 2019-11-06 05:42:59 UTC
Patch contains:

+       if (bne && BN_set_word(bne, e) != 1)
+               rsa = RSA_new();

However, BN_set_word() returns 1 on SUCCESS, and that is when you want to generate a new RSA key.  Note in all of the other examples in this patch, the clause following != 1 is the error case.

The result of this is the warning:

Nov  3 12:15:04 204.52.227.130 sm-mta[11101]: STARTTLS=server, error: RSA_generate_key failed

Hidden away in the system log for no-one to look at and the server to continue operating with.  The result, no encrypted inbound email.  This exposes your email to all and sundry, so I term it a vulnerability.  However, you cannot break into systems using this vulnerability (unless you are passing passwords around in email under the assumption that is should be encrypted).

Fix, change the != 1 to == 1.

I also am *extremely* dubious about the default of 512 bits of RSA key being used by sendmail for this key generation.  The "enhanced" default of 1024 bits for FIPS is pretty dubious as well (though possibly required).  I'm not sure what this RSA key is being used for, but 512 bits could be broken for $75 in 2015 https://arstechnica.com/information-technology/2015/10/breaking-512-bit-rsa-with-amazon-ec2-is-a-cinch-so-why-all-the-weak-keys/ so I cannot imagine it is a good default.  However, technically this is a different matter that the primary bug and nothing to do with gentoo patches being broken.  See RSA_KEYLENGTH in sendmail.h if you want to fix it as an extremely good idea.
Comment 1 David Kredba 2019-11-23 19:45:04 UTC
OpenSUSE uses the same code here
https://build.opensuse.org/package/view_file/openSUSE:Leap:15.0/sendmail/sendmail-8.15.2-openssl-1.1.0-fix.patch?expand=0
	
bne = BN_new();
+	if (bne && BN_set_word(bne, e) != 1)
+		rsa = RSA_new();
Comment 2 David Kredba 2019-11-23 19:47:06 UTC
OpenSUSE uses the same code here
https://build.opensuse.org/package/view_file/openSUSE:Leap:15.0/sendmail/sendmail-8.15.2-openssl-1.1.0-fix.patch

+	if (bne && BN_set_word(bne, e) != 1)
+		rsa = RSA_new();
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-03-30 15:18:47 UTC
From Seth Robertson here: https://bugs.gentoo.org/699414#c0
> I also am *extremely* dubious about the default of 512 bits of RSA key being
> used by sendmail for this key generation.  The "enhanced" default of 1024
> bits for FIPS is pretty dubious as well (though possibly required).  I'm not
> sure what this RSA key is being used for, but 512 bits could be broken for
> $75 in 2015
> https://arstechnica.com/information-technology/2015/10/breaking-512-bit-rsa-
> with-amazon-ec2-is-a-cinch-so-why-all-the-weak-keys/ so I cannot imagine it
> is a good default.  However, technically this is a different matter that the
> primary bug and nothing to do with gentoo patches being broken.  See
> RSA_KEYLENGTH in sendmail.h if you want to fix it as an extremely good idea.

I have filed this as bug 715470. Note that net-mail/sendmail is maintainer-needed,
so a patch would be appreciated.

Moving this bug away from security.
Comment 4 Larry the Git Cow gentoo-dev 2021-08-27 21:34:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2542b5fa54ad7471c5094910818f8c35cb284f9

commit e2542b5fa54ad7471c5094910818f8c35cb284f9
Author:     Conrad Kostecki <conikost@gentoo.org>
AuthorDate: 2021-08-27 21:29:34 +0000
Commit:     Conrad Kostecki <conikost@gentoo.org>
CommitDate: 2021-08-27 21:34:36 +0000

    mail-mta/sendmail: drop old version
    
    Bug: https://bugs.gentoo.org/730890
    Closes: https://bugs.gentoo.org/699414
    Package-Manager: Portage-3.0.22, Repoman-3.0.3
    Signed-off-by: Conrad Kostecki <conikost@gentoo.org>

 mail-mta/sendmail/Manifest                         |   1 -
 mail-mta/sendmail/files/libmilter-sharedlib.patch  |  55 ------
 .../files/sendmail-8.14.6-build-system.patch       | 211 ---------------------
 .../files/sendmail-8.15.2-glibc-2.30.patch         |  52 -----
 .../files/sendmail-8.15.2-openssl-1.1.0-fix.patch  | 182 ------------------
 .../files/sendmail-starttls-multi-crl.patch        |  20 --
 mail-mta/sendmail/sendmail-8.15.2-r2.ebuild        | 208 --------------------
 7 files changed, 729 deletions(-)