CVE-2022-2211: Buffer Overflow

Published Jun 24, 2022
·
Updated

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

12 affected componentsFixes available
libguestfs libguestfs
redhat Enterprise Linux=8.0
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
debian/guestfs-tools<1.48.2-1+deb12u1
1.48.2-1+deb12u1
debian/guestfs-tools<1.48.3-4
1.48.3-4
debian/guestfs-tools<1.48.3-4
1.48.3-4
debian/libguestfs<1:1.46.2-1
1:1.46.2-1
debian/libguestfs<1:1.46.2-1
1:1.46.2-1
debian/libguestfs<1:1.46.2-1
1:1.46.2-1
debian/guestfs-tools
1.48.2-1+deb12u11.52.3-11.56.1-1
debian/libguestfs
1:1.48.6-21:1.54.1-2+deb13u11:1.60.1-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/guestfs-tools to a version that resolves this vulnerability.

    Fixed in 1.48.2-1+deb12u1Fixed in 1.52.3-1Fixed in 1.56.1-1
  2. Upgrade

    Upgrade debian/libguestfs to a version that resolves this vulnerability.

    Fixed in 1:1.48.6-2Fixed in 1:1.54.1-2+deb13u1Fixed in 1:1.60.1-2
  3. Upgrade

    Upgrade debian/guestfs-tools to a version that resolves this vulnerability.

    Fixed in 1.48.2-1+deb12u1
  4. Upgrade

    Upgrade debian/guestfs-tools to a version that resolves this vulnerability.

    Fixed in 1.48.3-4
  5. Upgrade

    Upgrade debian/libguestfs to a version that resolves this vulnerability.

    Fixed in 1:1.46.2-1

Event History

Jun 24, 2022
Data Sourced
via Red Hat·01:44 PM
DescriptionSeverityAffected Software
Jul 12, 2022
CVE Published
via MITRE·08:33 PM
Data Sourced
via MITRE·08:33 PM
DescriptionWeakness
Data Sourced
via OSV·09:15 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-2211?

The severity of CVE-2022-2211 is medium with a severity value of 6.5.

2

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.

3

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.

4

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.

5

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

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203