Bug 28800 - nettle new security issues CVE-2021-3580 and CVE-2021-20305
Summary: nettle new security issues CVE-2021-3580 and CVE-2021-20305
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA7TOO MGA7-64-OK MGA8-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2021-04-18 00:42 CEST by David Walser
Modified: 2021-06-29 19:32 CEST (History)
5 users (show)

See Also:
Source RPM: nettle-3.6-1.mga8.src.rpm
CVE: CVE-2021-3580, CVE-2021-20305
Status comment:


Attachments

Description David Walser 2021-04-18 00:42:02 CEST
RedHat has issued an advisory on April 14:
https://access.redhat.com/errata/RHSA-2021:1206

The issue is fixed upstream in 3.7.2.

We'll also need to see what needs to be done for gnutls.

Mageia 7 and Mageia 8 are also affected.
David Walser 2021-04-18 00:42:15 CEST

Status comment: (none) => Fixed upstream in 3.7.2
Whiteboard: (none) => MGA8TOO, MGA7TOO

Comment 1 Lewis Smith 2021-04-18 08:46:54 CEST
new version: 3.7.2 is already in Cauldron, thanks to DavidG.
Can we leave this with you (rather than assigning it globally), since this pkg has no regular maintainer?

Assignee: bugsquad => geiger.david68210

David Walser 2021-04-18 16:24:12 CEST

Version: Cauldron => 8
Whiteboard: MGA8TOO, MGA7TOO => MGA7TOO

Comment 2 David Walser 2021-05-28 21:05:22 CEST
Ubuntu has issued an advisory for this on April 13:
https://ubuntu.com/security/notices/USN-4906-1
Comment 3 David Walser 2021-05-29 19:59:17 CEST
Fedora has issued an advisory for this on March 24:
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/WFQW4L3RFRTEMBPVMGCLTVYKHV7ZVPZK/

Upstream announcement:
https://lists.lysator.liu.se/pipermail/nettle-bugs/2021/009458.html

GnuTLS issue is in Bug 29021.

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=29021

Comment 4 David Walser 2021-05-30 22:44:45 CEST
openSUSE has issued an advisory for this on May 1:
https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/JEQQBLTWQPDTYRTWQZSXENUU6TSCBJ5R/
Comment 5 David GEIGER 2021-06-07 13:20:59 CEST
Done for mga8!
Comment 6 David Walser 2021-06-09 02:00:38 CEST
Mageia 7 still needs to be addressed.  Should be able to borrow patches for 3.4.x from CentOS 8, Ubuntu 18.04, or openSUSE 15.2.

RPMS for Mageia 8:
nettle-3.7.2-1.mga8
libhogweed6-3.7.2-1.mga8
libnettle8-3.7.2-1.mga8
libnettle-devel-3.7.2-1.mga8
Comment 7 David Walser 2021-06-21 19:07:14 CEST
Debian has issued an advisory on June 18:
https://www.debian.org/security/2021/dsa-4933

The new issue is fixed upstream in 3.7.3.

We should be able to borrow patches from them for 3.4.x.

Whiteboard: MGA7TOO => MGA8TOO, MGA7TOO
Status comment: Fixed upstream in 3.7.2 => Fixed upstream in 3.7.3
Version: 8 => Cauldron
Summary: nettle new security issue CVE-2021-20305 => nettle new security issues CVE-2021-3580 and CVE-2021-20305

Comment 8 David Walser 2021-06-21 19:12:01 CEST
Ubuntu has issued an advisory for this on June 17:
https://ubuntu.com/security/notices/USN-4990-1
Comment 10 David Walser 2021-06-25 00:24:15 CEST
openSUSE has issued an advisory for CVE-2021-3580 today (June 24):
https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/D4XGPKTRWLOEATNJNZGQZCO6BZTKIKJ6/
Comment 11 David Walser 2021-06-27 20:22:48 CEST
Advisory:
========================

Updated nettle packages fix security vulnerabilities:

Remote crash in RSA decryption via manipulated ciphertext (CVE-2021-3580).

A flaw was found in Nettle in versions before 3.7.2, where several Nettle
signature verification functions (GOST DSA, EDDSA & ECDSA) result in the
Elliptic Curve Cryptography point (ECC) multiply function being called with
out-of-range scalers, possibly resulting in incorrect results. This flaw
allows an attacker to force an invalid signature, causing an assertion
failure or possible validation (CVE-2021-20305).

The Mageia 8 nettle package has been updated to version 3.7.3 and the Mageia 7
nettle package has been patched to fix these issues.

References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3580
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-20305
https://lists.lysator.liu.se/pipermail/nettle-bugs/2021/009458.html
https://lists.lysator.liu.se/pipermail/nettle-bugs/2021/009545.html
https://ubuntu.com/security/notices/USN-4906-1
https://ubuntu.com/security/notices/USN-4990-1
========================

Updated packages in core/updates_testing:
========================
nettle-3.4.1-1.1.mga7
libnettle6-3.4.1-1.1.mga7
libhogweed4-3.4.1-1.1.mga7
libnettle-devel-3.4.1-1.1.mga7
nettle-3.7.3-1.mga8
libhogweed6-3.7.3-1.mga8
libnettle8-3.7.3-1.mga8
libnettle-devel-3.7.3-1.mga8

from SRPMS:
nettle-3.4.1-1.1.mga7.src.rpm
nettle-3.7.3-1.mga8.src.rpm

Version: Cauldron => 8
Assignee: geiger.david68210 => qa-bugs
CC: (none) => geiger.david68210
Status comment: Fixed upstream in 3.7.3 => (none)
Whiteboard: MGA8TOO, MGA7TOO => MGA7TOO

Comment 12 Len Lawrence 2021-06-27 23:13:51 CEST
mga7, x64

Installed any missing core packages.
Introduction at https://www.linuxfromscratch.org/blfs/view/svn/postlfs/nettle.html

There do not seem to be any PoC tests.
Tried out some commands.
$ nettle-hash --algorithm=sha512 manifest
manifest: fce391c58dbae004 da37fa63a11cc8d1 f3bf5c367628dcc6 a87c5e855303bf6a e5abce6b16c5261f 645d825c43ff2031 ad30783fe86fb57b 3053feea857d1836 sha512

$ nettle-lfib-stream
Omitting a seed.
Generated a stream of encrypted data (to be used as test data only).

Difficult to figure out exactly how to use this package - minimal help and no man pages.

viz:
$ pkcs1-conv id_rsa id_rsa.pub
Ignoring unsupported object type `OPENSSH PRIVATE KEY'.

There is also an sexp-conv utility.

Going ahead with the update using qarepo and MageiaUpdate.
$ rpm -qa | grep nettle
lib64nettle-devel-3.4.1-1.1.mga7
lib64nettle6-3.4.1-1.1.mga7
nettle-3.4.1-1.1.mga7
$ rpm -q lib64hogweed4
lib64hogweed4-3.4.1-1.1.mga7

$ nettle-hash --algorithm=sha3_256 list
list: 58945647534e7af5 22e120e69da5be1b 79bbb0dce1e39543 d57c8a90581b06d1 sha3_256
$ nettle-lfib-stream
Interrupted the output stream with SIGINT.

This is as far as it goes.  All we can say is no detectable regressions.

CC: (none) => tarazed25
Whiteboard: MGA7TOO => MGA7TOO MGA7-64-OK

Comment 13 David Walser 2021-06-27 23:17:36 CEST
If there's no PoC, testing the nettle package itself doesn't really tell you anything.  Packages that use the library need to be tested, especially on Mageia 8 since it was updated.
Comment 14 Len Lawrence 2021-06-27 23:24:05 CEST
Yes, I just realized that I had not checked the requires.  Most of these are unfamiliar territory.  Shall try some tomorrow but don't have much spare time - out of town for a week from Wednesday.

aria2
chrony
claws-mail
dnsmasq
epiphany
filezilla
ocaml-ocamlnet
qemu*
rdesktop
tigervnc-server
viking

Whiteboard: MGA7TOO MGA7-64-OK => MGA7TOO

Comment 15 Len Lawrence 2021-06-28 08:38:53 CEST
Continuing from comment 14.

Ran epiphany under strace.
$ grep nettle epiphany.trace
openat(AT_FDCWD, "/lib64/libnettle.so.6", O_RDONLY|O_CLOEXEC) = 3
read(13, "          /usr/lib64/libnettle.s"..., 1024) = 1024

Installed viking using urpmi.
$ grep aria2 urpmi.trace
stat("/usr/bin/aria2c", {st_mode=S_IFREG|0755, st_size=2041832, ...}) = 0
......
$ grep nettle urpmi.trace
stat("/usr/share/doc/lib64nettle-devel/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

Ran viking under strace.  Help->about indicates that the package is a "GPS Data and Topo Analyzer, Explorer, and Manager".  The gui came up with default coordinates 5 hours west of here, somewhere in the USA.  Most of the tools were greyed out but ruler worked, showing the distance between two points.  No idea what to do with it.  Browsed the manual which gives the impression that the application is not much use without a GPS device.  None here.  It looks like a powerful program though.
$ grep nettle viking.trace
openat(AT_FDCWD, "/lib64/libnettle.so.6", O_RDONLY|O_CLOEXEC) = 3

These quick tests show that nettle is being used in some fashion.  Letting it go.
Len Lawrence 2021-06-28 08:39:27 CEST

Whiteboard: MGA7TOO => MGA7TOO MGA7-64-OK

Comment 16 Len Lawrence 2021-06-28 12:16:17 CEST
mga8, x64

Installed nettle components and updated.
Tried out a couple of nettle cli tools then applications which use it:
epiphany browser, aria2 and viking.

$ grep nettle epiphany.trace
openat(AT_FDCWD, "/usr/lib64/epiphany/libnettle.so.8", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib64/libnettle.so.8", O_RDONLY|O_CLOEXEC) = 3

$ sudo strace -o aria2.trace urpmi viking
$ grep nettle aria2.trace
write(5, "lib64hogweed6\nnettle\nlib64nettle"..., 58) = 58
stat("/usr/share/doc/nettle/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/share/doc/lib64nettle-devel/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

Tinkered with the viking interface, which looks fully functional.
$ grep nettle viking.trace
openat(AT_FDCWD, "/lib64/libnettle.so.8", O_RDONLY|O_CLOEXEC) = 3

Hoping this is sufficient.

Whiteboard: MGA7TOO MGA7-64-OK => MGA7TOO MGA7-64-OK MGA8-64-OK

Comment 17 Thomas Andrews 2021-06-29 13:42:20 CEST
"Hogweed." Named after some nasty stuff. The sap produces very bad burns on the skin. The State of New York is on a campaign to eliminate it, if possible. 

But I digress. I'm going to validate. Advisory in Comment 11.

CC: (none) => andrewsfarm, sysadmin-bugs
Keywords: (none) => validated_update

Aurelien Oudelet 2021-06-29 15:42:41 CEST

Keywords: (none) => advisory
CC: (none) => ouaurelien
CVE: (none) => CVE-2021-3580, CVE-2021-20305

Comment 18 Mageia Robot 2021-06-29 19:32:56 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2021-0300.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.