[FreeBSD-Announce] FreeBSD Security Advisory FreeBSD-SA-21:16.openssl

FreeBSD Security Advisories security-advisories at freebsd.org
Tue Aug 24 20:53:01 UTC 2021

Hash: SHA512

FreeBSD-SA-21:16.openssl                                    Security Advisory
                                                          The FreeBSD Project

Topic:          Multiple OpenSSL vulnerabilities

Category:       contrib
Module:         openssl
Announced:      2021-08-24
Credits:        See OpenSSL advisory in references.
Affects:        FreeBSD 12.2 and later.
Corrected:      2021-08-24 18:05:48 UTC (stable/13, 13.0-STABLE)
                2021-08-24 18:08:04 UTC (releng/13.0, 13.0-RELEASE-p4)
                2021-08-24 18:30:22 UTC (stable/12, 12.2-STABLE)
                2021-08-24 18:32:19 UTC (releng/12.2, 12.2-RELEASE-p10)
CVE Name:       CVE-2021-3711, CVE-2021-3712

For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit <URL:https://security.FreeBSD.org/>.

I.   Background

FreeBSD includes software from the OpenSSL Project.  The OpenSSL Project is a
collaborative effort to develop a robust, commercial-grade, full-featured
Open Source toolkit for the Transport Layer Security (TLS) protocol.  It is
also a general-purpose cryptography library.

II.  Problem Description

There are two issues fixed in this security advisory:

A bug in the SM2 decryption implementation incorrectly calculates a buffer
needed to hold the plaintext leading to a potential buffer overflow.

ASN1_STRING structures directly constructed, instead of using library
functions, may not be NULL-terminated resulting in library functions causing
a read buffer overrun. [CVE-2021-3712]

III. Impact

Specially crafted decrypted SM2 content could cause attacker chosen data to
overflow the buffer changing application behavior or causing the application
to crash. [CVE-2021-3711]

A specially crafted malicious string can cause an application that directly
constructs the ASN1_STRING structure to crash or disclose memory contents.

IV.  Workaround

No workaround is available.

V.   Solution

Upgrade your vulnerable system to a supported FreeBSD stable or
release / security branch (releng) dated after the correction date.

Perform one of the following:

1) To update your vulnerable system via a binary patch:

Systems running a RELEASE version of FreeBSD on the amd64, i386, or
(on FreeBSD 13 and later) arm64 platforms can be updated via the
freebsd-update(8) utility:

# freebsd-update fetch
# freebsd-update install

2) To update your vulnerable system via a source code patch:

The following patches have been verified to apply to the applicable
FreeBSD release branches.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

[FreeBSD 13.0]
# fetch https://security.FreeBSD.org/patches/SA-21:16/openssl.13.patch
# fetch https://security.FreeBSD.org/patches/SA-21:16/openssl.13.patch.asc
# gpg --verify openssl.13.patch.asc

[FreeBSD 12.2]
# fetch https://security.FreeBSD.org/patches/SA-21:16/openssl.12.patch
# fetch https://security.FreeBSD.org/patches/SA-21:16/openssl.12.patch.asc
# gpg --verify openssl.12.patch.asc

b) Apply the patch.  Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile the operating system using buildworld and installworld as
described in <URL:https://www.FreeBSD.org/handbook/makeworld.html>.

Restart all daemons that use the library, or reboot the system.

VI.  Correction details

This issue is corrected by the corresponding Git commit hash or Subversion
revision number in the following stable and release branches:

Branch/path                             Hash                     Revision
- -------------------------------------------------------------------------
stable/13/                              9d31ae318711    stable/13-n246940
releng/13.0/                            2261c814b7fa  releng/13.0-n244759
stable/12/                                                        r370385
releng/12.2/                                                      r370396
- -------------------------------------------------------------------------

For FreeBSD 13 and later:

Run the following command to see which files were modified by a
particular commit:

# git show --stat <commit hash>

Or visit the following URL, replacing NNNNNN with the hash:


To determine the commit count in a working tree (for comparison against
nNNNNNN in the table above), run:

# git rev-list --count --first-parent HEAD

For FreeBSD 12 and earlier:

Run the following command to see which files were modified by a particular
revision, replacing NNNNNN with the revision number:

# svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base

Or visit the following URL, replacing NNNNNN with the revision number:


VII. References




The latest revision of this advisory is available at


More information about the freebsd-announce mailing list