Issue metadata
Sign in to add a comment
|
strongswan vulnerability CVE-2017-9022 and CVE-2017-9023 |
||||||||||||||||||||||
Issue description
The following vulnerability has been reported by strongswan developers:
###
We recently started fuzzing some of our plugins using Google's OSS-Fuzz
infrastructure [1]. This lead to the discovery of several bugs. Two of
them may lead to denial-of-service attacks. One affects the gmp plugin,
the other the ASN.1 parser in combination with the x509 plugin.
# Insufficient Input Validation in gmp Plugin
RSA public keys passed to the gmp plugin aren't validated sufficiently
before attempting signature verification, so that invalid input might
lead to a floating point exception. Affected are all strongSwan
versions since 4.4.0 including the latest 5.5.2.
CVE-2017-9022 has been assigned for this vulnerability.
With strongSwan 4.4.0 the gmp plugin started to use mpz_powm_sec(), if
available, for side-channel-free exponentiation. Compared to mpz_powm()
this function has two additional requirements regarding the passed
exponent and modulus: The exponent must be larger than zero and the
modulus must be odd. If these requirements are not met the calculations
performed by libgmp will result in a floating point exception that
crashes the whole process. Until now the plugin simply replaced
mpz_powm() with mpz_powm_sec() without any additional input checks. So
a certificate with an appropriately prepared public key sent by a peer
could be used for a denial-of-service attack.
Remote code execution is not possible due to this issue.
# Incorrect Handling of CHOICE types in ASN.1 parser and x509 plugin
ASN.1 CHOICE types are not correctly handled by the ASN.1 parser when
parsing X.509 certificates with extensions that use such types. This
could lead to infinite looping of the thread parsing a specifically
crafted certificate. Affected are all strongSwan versions including the
latest 5.5.2 (please note that patches for versions < 4.4.0 are not
provided).
CVE-2017-9023 has been assigned for this vulnerability.
Several extensions in X.509 certificates use CHOICE types to allow
exactly one of several possible sub-elements. An extension that's
defined like this, which strongSwan always supported, is
CRLDistributionPoints, where the optional distributionPoint is defined
as follows:
DistributionPointName ::= CHOICE {
fullName [0] GeneralNames,
nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
So it may either be a GeneralName or an RDN but not both and one of them
must be present if there is a distributionPoint. So far the x509 plugin
and ASN.1 parser treated the choices simply as optional elements inside
of a loop, without enforcing that exactly one of them was parsed (or
that any of them were matched). This lead to the issue that if none of
the options were found the parser was stuck in an infinite loop. Other
extensions that are affected are ipAddrBlocks (supported since 4.3.6)
and CertificatePolicies (since 4.5.1).
A similar issue, for which no separate CVE is assigned, affects the
nameConstraints extension (supported since 4.5.1), where the x509 plugin
incorrectly defined a parsing rule with a loop, where there was none
defined, so that invalid data could lead to an infinite loop.
Remote code execution is not possible due to these issues.
# Mitigation
Since only specific plugins are affected (gmp, x509) installations that
don't have these plugins enabled and loaded are not vulnerable.
The attached patches fix the vulnerabilities in the respective
strongSwan versions and should apply with appropriate hunk offsets.
Please prepare updated releases and patch your installations, but do not
yet publicly disclose any information about this vulnerability. We want
to give you as a partner enough time to prepare new releases and will
publicly disclose the vulnerability with the strongSwan 5.5.3 release on
Tue May 30, 14:00 CEST.
As mentioned in the introduction, credit to OSS-Fuzz for finding these
vulnerabilities, and to Sven Defatsch for setting up the integration and
creating the fuzz target.
Our apologies for the inconvenience.
Kind Regards
Tobias Brunner
strongSwan Developer
[1] https://github.com/google/oss-fuzz
,
May 18 2017
Yeah, if RCE is not possible with these issues, we can probably move this to a P2.
,
May 26 2017
The NextAction date has arrived: 2017-05-26
,
May 26 2017
Any idea when 5.5.3 will be available in Gentoo?
,
May 26 2017
strongswan.org still says 5.5.2 is the latest. 5.5.3 release date is Tuesday of next week according to the advisory. I'm guessing Gentoo will pick it up in a week or two at worst?
,
May 26 2017
That sounds good.
,
May 26 2017
,
Jun 7 2017
The NextAction date has arrived: 2017-06-07
,
Jun 7 2017
5.5.3 is in upstream portage, looking at it now.
,
Jun 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/b1a2bc0c630f08d2afea86c64e48c2cb2b01b156 commit b1a2bc0c630f08d2afea86c64e48c2cb2b01b156 Author: Kevin Cernekee <cernekee@chromium.org> Date: Thu Jun 08 06:45:27 2017 net-vpn/strongswan: Bump version to 5.5.3 This fixes a couple of DoS bugs. Also, it has been moved from the net-misc category to net-vpn, so references were updated accordingly. BUG= chromium:723794 TEST=VPN autotests CQ-DEPEND=CL:*390750 Change-Id: Ib4b2ef3eed5c19e6f58c1bb87a27a0fe06286f65 Reviewed-on: https://chromium-review.googlesource.com/527684 Commit-Ready: Kevin Cernekee <cernekee@chromium.org> Tested-by: Kevin Cernekee <cernekee@chromium.org> Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [delete] https://crrev.com/1415f52fba8b27fa762fe6439bdeae602ef2b303/net-misc/strongswan/Manifest [add] https://crrev.com/b1a2bc0c630f08d2afea86c64e48c2cb2b01b156/net-vpn/strongswan/strongswan-5.5.3-r1.ebuild [rename] https://crrev.com/b1a2bc0c630f08d2afea86c64e48c2cb2b01b156/net-vpn/strongswan/strongswan-5.5.3.ebuild [rename] https://crrev.com/b1a2bc0c630f08d2afea86c64e48c2cb2b01b156/net-vpn/strongswan/files/ipsec [modify] https://crrev.com/b1a2bc0c630f08d2afea86c64e48c2cb2b01b156/chromeos-base/vpn-manager/vpn-manager-9999.ebuild [add] https://crrev.com/b1a2bc0c630f08d2afea86c64e48c2cb2b01b156/net-vpn/strongswan/Manifest [modify] https://crrev.com/b1a2bc0c630f08d2afea86c64e48c2cb2b01b156/profiles/targets/chromeos/package.use [rename] https://crrev.com/b1a2bc0c630f08d2afea86c64e48c2cb2b01b156/net-vpn/strongswan/metadata.xml
,
Jun 8 2017
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-loonix-private/+/b920478f0d4892636343741d1429794e71ad1f99 commit b920478f0d4892636343741d1429794e71ad1f99 Author: Ben Chan <benchan@chromium.org> Date: Thu Jun 08 06:45:27 2017
,
Jun 8 2017
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-loonix-private/+/b920478f0d4892636343741d1429794e71ad1f99 commit b920478f0d4892636343741d1429794e71ad1f99 Author: Ben Chan <benchan@chromium.org> Date: Thu Jun 08 06:45:27 2017
,
Jun 8 2017
Thanks for the fixes! Are we missing any CLs here, or can we mark as fixed?
,
Jun 8 2017
,
Jun 9 2017
,
Sep 15 2017
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 22 2018
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by cernekee@chromium.org
, May 18 2017