Bug 1757258 (CVE-2019-14850)

Summary: CVE-2019-14850 nbdkit: denial of service due to premature opening of back-end connection
Product: [Other] Security Response Reporter: Doran Moppert <dmoppert>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: dblechte, dfediuck, eedri, libvirt-maint, mgoldboi, michal.skrivanek, rjones, sbonazzo, sherold, yturgema
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nbdkit 1.12.7, nbdkit 1.14.1, nbdkit 1.15.1 Doc Type: If docs needed, set a value
Doc Text:
A denial of service vulnerability was discovered in nbdkit. An attacker could connect to the nbdkit service and cause it to perform a large amount of work in initializing backend plugins, by simply opening a connection to the service. This vulnerability could cause resource consumption and degradation of service in nbdkit, depending on the plugins configured on the server-side.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 22:35:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1757260, 1757261, 1757262, 1757263, 1757264, 1757265, 1757639    
Bug Blocks: 1751960, 1940172    

Description Doran Moppert 2019-10-01 01:20:33 UTC
An attacker, by connecting to nbdkit’s TCP port, is able to make the current plugin’s .open() callback run.  For some plugins this callback
does a considerable amount of work, for example connecting to a remote machine (nbdkit-ssh-plugin) or launching a small VM (nbdkit-guestfs-plugin).  Thus for a small amount of work done by the attacker (opening many TCP connections but not sending any data), a large amount of work is done by nbdkit (eg. making many full ssh connections to a remote machine or launching hundreds of VMs).

A related problem is that if nbdkit is configured to use TLS for client authentication, even clients which are not authorized are able to attack nbdkit in this way because all they have to do is open a TCP connection.

Mitigating this is that the current plugin is NOT selected by the attacker, but is part of the server configuration.  Therefore the effectiveness of the attack depends on the particular configuration.

Comment 1 Doran Moppert 2019-10-01 01:20:39 UTC
Acknowledgments:

Name: Richard W. M. Jones (Red Hat)

Comment 2 Doran Moppert 2019-10-01 01:20:42 UTC
External References:

https://www.redhat.com/archives/libguestfs/2019-September/msg00084.html

Comment 3 Doran Moppert 2019-10-01 01:20:46 UTC
Mitigation:

This attack is only possible if nbdkit is configured with a plugin that does a lot of work in its initial .open() callback. Some examples that do a lot of work are nbdkit-ssh-plugin and nbdkit-guestfs-plugin. The nbdkit-memory-plugin is an example that does very little work, and thus is not subject to this vulnerability.

Only attackers that can connect to the nbdkit service can exploit this vulnerability. If nbdkit is not exposed over TCP (eg, nbdkit -U), or is bound only to a private network interface, or is protected by firewall rules, the attack surface is correspondingly limited.

Comment 5 Doran Moppert 2019-10-01 01:23:16 UTC
Created nbdkit tracking bugs for this issue:

Affects: epel-7 [bug 1757265]
Affects: fedora-all [bug 1757264]

Comment 9 Doran Moppert 2019-10-01 23:26:33 UTC
Statement:

Red Hat Virtualization Host includes nbdkit as a dependency of libguestfs, and uses it in p2v/v2v migrations. libguestfs uses nbdkit with a Unix domain socket only, so this vulnerability is not exposed to untrusted users.

Red Hat Virtualization 4.2 EUS includes a vulnerable version of nbdkit, however it is used only on the Hypervisor with a Unix domain socket, so this vulnerability is not exposed to untrusted users.

Comment 12 errata-xmlrpc 2020-03-31 19:29:23 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:1167 https://access.redhat.com/errata/RHSA-2020:1167

Comment 13 Product Security DevOps Team 2020-03-31 22:35:29 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-14850