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.
Acknowledgments: Name: Richard W. M. Jones (Red Hat)
External References: https://www.redhat.com/archives/libguestfs/2019-September/msg00084.html
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.
Created nbdkit tracking bugs for this issue: Affects: epel-7 [bug 1757265] Affects: fedora-all [bug 1757264]
NOTE: the upstream patches for this issue introduced another flaw, of higher severity than this one (bug 1757259). The patch for this vulnerability and for bug 1757259 should be applied together. Upstream patches: 1.15 (development branch): - https://github.com/libguestfs/nbdkit/commit/c05686f9577fa91b6a3a4d8c065954ca6fc3fd62 - https://github.com/libguestfs/nbdkit/commit/a6b88b195a959b17524d1c8353fd425d4891dc5f 1.14: - https://github.com/libguestfs/nbdkit/commit/e06cde00659ff97182173d0e33fff784041bcb4a - https://github.com/libguestfs/nbdkit/commit/bf0d61883a2f02f4388ec10dc92d4c61c093679e 1.12: - https://github.com/libguestfs/nbdkit/commit/22b30adb796bb6dca264a38598f80b8a234ff978 - https://github.com/libguestfs/nbdkit/commit/b2bc6683ea3cd1f6be694e8a681dfa411b7d15f3
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.
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
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