Bug 1201064 (CVE-2022-2211) - VUL-0: CVE-2022-2211: Libguestfs: Buffer overflow in get_keys leads to DOS
Summary: VUL-0: CVE-2022-2211: Libguestfs: Buffer overflow in get_keys leads to DOS
Status: RESOLVED FIXED
Alias: CVE-2022-2211
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/335936/
Whiteboard: CVSSv3.1:SUSE:CVE-2022-2211:5.5:(AV:L...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-30 16:40 UTC by Charles Arnold
Modified: 2024-05-14 15:50 UTC (History)
6 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Upstream Fix (4.15 KB, patch)
2022-06-30 16:40 UTC, Charles Arnold
Details | Diff
Upstream documentation for the fix (2.36 KB, patch)
2022-06-30 16:41 UTC, Charles Arnold
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Arnold 2022-06-30 16:40:31 UTC
Created attachment 859933 [details]
Upstream Fix

A buffer overflow was found in get_keys()

When calculating the greatest possible number of matching keys in
get_keys(), the current expression

  MIN (1, ks->nr_keys)

is wrong -- it will return at most 1.

If all "nr_keys" keys match however, then we require "nr_keys" non-NULL
entries in the result array; in other words, we need

  MAX (1, ks->nr_keys)

(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 "OPTION_key". 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.


Reference:
https://bugzilla.redhat.com/show_bug.cgi?id=2100862

Only libguestfs in SLE15-SP4 and Tumbleweed are affected.
Comment 1 Charles Arnold 2022-06-30 16:41:29 UTC
Created attachment 859934 [details]
Upstream documentation for the fix
Comment 2 Charles Arnold 2022-06-30 16:51:24 UTC
Packages affected in SLE15-SP4
libguestfs
virt-v2v

Packages affected in Tumbleweed
libguestfs
guestfs-tools
virt-v2v
Comment 4 OBSbugzilla Bot 2022-07-01 16:40:03 UTC
This is an autogenerated message for OBS integration:
This bug (1201064) was mentioned in
https://build.opensuse.org/request/show/986262 Factory / libguestfs
https://build.opensuse.org/request/show/986263 Factory / guestfs-tools
https://build.opensuse.org/request/show/986264 Factory / virt-v2v
Comment 5 Swamp Workflow Management 2022-07-28 19:15:38 UTC
SUSE-SU-2022:2581-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1201064
CVE References: CVE-2022-2211
JIRA References: 
Sources used:
openSUSE Leap 15.4 (src):    libguestfs-1.44.2-150400.3.3.1
SUSE Linux Enterprise Module for Server Applications 15-SP4 (src):    libguestfs-1.44.2-150400.3.3.1
SUSE Linux Enterprise Module for Development Tools 15-SP4 (src):    libguestfs-1.44.2-150400.3.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 6 Thomas Leroy 2022-09-01 12:04:44 UTC
Hi Charles, could you please submit to SUSE:SLE-15-SP4:Update/virt-v2v? :)
Comment 8 Charles Arnold 2022-09-01 14:33:46 UTC
Submissions complete. Assigning back to security team.
Comment 10 Swamp Workflow Management 2022-12-01 20:19:55 UTC
SUSE-SU-2022:4308-1: An update that fixes one vulnerability is now available.

Category: security (moderate)
Bug References: 1201064
CVE References: CVE-2022-2211
JIRA References: 
Sources used:
openSUSE Leap 15.4 (src):    virt-v2v-1.44.2-150400.3.3.1
SUSE Linux Enterprise Module for Server Applications 15-SP4 (src):    virt-v2v-1.44.2-150400.3.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 12 Robert Frohl 2024-04-19 11:24:32 UTC
done