CVE-2022-2211: Buffer Overflow
A buffer overflow was found in getkeys getkeys()
When calculating the greatest possible number of matching keys in getkeys(), the current expression
MIN (1, ks->nrkeys)
is wrong -- it will return at most 1.
If all "nrkeys" keys match however, then we require "nrkeys" non-NULL entries in the result array; in other words, we need
MAX (1, ks->nrkeys)
(The comment just above the expression is correct; the code is wrong.)
This buffer overflow is easiest to trigger in those guestfs tools that parse the "--key" option in C; that is, with "OPTIONkey". For example, the command
$ virt-cat $(seq -f '--key /dev/sda2:key:%g' 200) -d DOMAIN /no-such-file
which passes 200 (different) passphrases for the LUKS-encrypted block device "/dev/sda2", crashes with a SIGSEGV.
Other sources
A vulnerability was found in libguestfs. This issue occurs while calculating the greatest possible number of matching keys in the getkeys() function. This flaw leads to a denial of service, either by mistake or malicious actor.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2022-2211?
The severity of CVE-2022-2211 is medium with a severity value of 6.5.
Which software is affected by CVE-2022-2211?
Libguestfs and Redhat Enterprise Linux versions 8.0 and 9.0 are affected by CVE-2022-2211.
How does CVE-2022-2211 lead to a denial of service?
CVE-2022-2211 leads to a denial of service by miscalculating the greatest possible number of matching keys in the get_keys() function.
How can I fix CVE-2022-2211?
To fix CVE-2022-2211, you should update to the latest version of libguestfs or Redhat Enterprise Linux that includes the necessary security patches.
Where can I find more information about CVE-2022-2211?
You can find more information about CVE-2022-2211 in the following references: - Bugzilla: https://bugzilla.redhat.com/show_bug.cgi/show_bug.cgi?id=2101279 - Red Hat Security Advisory: https://access.redhat.com/security/cve/CVE-2022-2211 - Libguestfs Mailing List: https://listman.redhat.com/archives/libguestfs/2022-June/029274.html