# CVE-2022-2211: Denial of service in libguestfs

> A flaw in libguestfs allows attackers to cause a denial of service via the get_keys function.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 12 Jul 2022
- **Updated:** 3 Aug 2024
- **Also known as:** ALSA-2022:7958, ALSA-2022:7959, ALSA-2022:7968, DEBIAN-CVE-2022-2211, GHSA-8rvm-f29f-fjx6, RHSA-2022:7958, RHSA-2022:7959, RHSA-2022:7968, RLSA-2022:7958, RLSA-2022:7959, RLSA-2022:7968, SUSE-SU-2022:2581-1, SUSE-SU-2022:4308-1, UBUNTU-CVE-2022-2211, openSUSE-SU-2024:12164-1, openSUSE-SU-2024:12165-1, openSUSE-SU-2024:12166-1

## What is CVE-2022-2211?

CVE-2022-2211 is a medium-severity denial of service vulnerability in Redhat Enterprise Linux, published on 12 Jul 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

A vulnerability was found in libguestfs. This issue occurs while calculating the greatest possible number of matching keys in the get_keys() function. This flaw leads to a denial of service, either by mistake or malicious actor.

Weakness: CWE-120 (Buffer Copy without Checking Size of Input)

## Which versions are affected by CVE-2022-2211?

It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `guestfs-tools` | AlmaLinux:9 | All versions | 1.48.2-5.el9 |
| `libguestfs` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-appliance` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-bash-completion` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-devel` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-gobject` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-gobject-devel` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-inspect-icons` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-man-pages-ja` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-man-pages-uk` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-rescue` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-rsync` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `libguestfs-xfs` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `lua-guestfs` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `ocaml-libguestfs` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `ocaml-libguestfs-devel` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `perl-Sys-Guestfs` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `php-libguestfs` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `python3-libguestfs` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `ruby-libguestfs` | AlmaLinux:9 | All versions | 1:1.48.4-2.el9.alma |
| `virt-v2v` | AlmaLinux:9 | All versions | 1:2.0.7-6.el9 |
| `virt-v2v-bash-completion` | AlmaLinux:9 | All versions | 1:2.0.7-6.el9 |
| `virt-v2v-man-pages-ja` | AlmaLinux:9 | All versions | 1:2.0.7-6.el9 |
| `virt-v2v-man-pages-uk` | AlmaLinux:9 | All versions | 1:2.0.7-6.el9 |
| `virt-win-reg` | AlmaLinux:9 | All versions | 1.48.2-5.el9 |
| `guestfs-tools` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.48.2-5.el9 |
| `guestfs-tools-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.48.2-5.el9 |
| `guestfs-tools-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:1.48.2-5.el9 |
| `libguestfs` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-appliance` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-bash-completion` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-gobject-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-inspect-icons` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-rescue` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-rescue-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-rsync` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `libguestfs-xfs` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |
| `lua-guestfs-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 1:1.48.4-2.el9 |

Products: Libguestfs Libguestfs, Redhat Enterprise Linux.

## How do I fix CVE-2022-2211?

Apply the vendor's patch.

## Is CVE-2022-2211 being exploited?

There is no known exploitation of CVE-2022-2211 in the wild and no public exploit code.

## Other vulnerabilities in Redhat Enterprise Linux

- [CVE-2013-4419](https://insights.sbomify.com/CVE-2013-4419/): Race condition in n/a (medium 6.8)
- [CVE-2010-3851](https://insights.sbomify.com/CVE-2010-3851/): Information disclosure in n/a (medium 4.7)
- [CVE-2013-2124](https://insights.sbomify.com/CVE-2013-2124/): Use after free in n/a (medium 4.3)
- [CVE-2012-2690](https://insights.sbomify.com/CVE-2012-2690/): Information disclosure in n/a (low 2.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-2211 and fix it if it is affected.

What it is: CVE-2022-2211 is a medium-severity denial of service vulnerability in Redhat Enterprise Linux, published on 12 Jul 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-2211 in the wild and no public exploit code.

Affected product: Redhat Enterprise Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-2211/ (Markdown: https://insights.sbomify.com/CVE-2022-2211/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-2211
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-2211
- OSV: https://osv.dev/vulnerability/CVE-2022-2211

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-2211/
Summaries are generated and may contain mistakes; the official description above is the record.
