Bug 1191893 - (CVE-2021-3872) VUL-0: CVE-2021-3872: vim: heap-based buffer overflow in win_redr_status() drawscreen.c
(CVE-2021-3872)
VUL-0: CVE-2021-3872: vim: heap-based buffer overflow in win_redr_status() dr...
Status: IN_PROGRESS
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P3 - Medium : Normal
: ---
Assigned To: Zoltan Balogh
Security Team bot
https://smash.suse.de/issue/312873/
CVSSv3.1:SUSE:CVE-2021-3872:7.8:(AV:L...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-21 08:51 UTC by Thomas Leroy
Modified: 2022-05-18 12:47 UTC (History)
3 users (show)

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


Attachments
CVE-2021-3872 fix backported to vim 7.2 SLE11-SP2-Update (1.31 KB, patch)
2022-05-18 12:47 UTC, Ali Abdallah
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Leroy 2021-10-21 08:51:31 UTC
rh#2016056

vim is vulnerable to heap-based buffer overflow.
Every version below 8.2.3487 are impacted.

Reproducer:

$ LD=lld AS=llvm-as AR=llvm-ar RANLIB=llvm-ranlib CC=clang CXX=clang++ CFLAGS="-fsanitize=address" CXXFLAGS="-fsanitize=address" LDFLAGS="-ldl -fsanitize=address" ./configure --with-features=huge --enable-gui=none
$ make
$ echo "ZggwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCmYIMH8wMDAwMDAlJSUlJSUlJSUlJTAwMDAwMPz//wplJSUlJSUlJSUlJSUlJSUKdnMKdjD/MG8=" | base64 -d > /tmp/crash0000.fuzz
$ vim -u NONE -X -Z -e -s -S /tmp/crash0000.fuzz -c :qa!


Reference:
https://huntr.dev/bounties/c958013b-1c09-4939-92ca-92f50aa169e8

Upstream patch:
https://github.com/vim/vim/commit/826bfe4bbd7594188e3d74d2539d9707b1c6a14b

References:
https://bugzilla.redhat.com/show_bug.cgi?id=2016056
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3872
https://github.com/vim/vim/commit/826bfe4bbd7594188e3d74d2539d9707b1c6a14b
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3872
https://huntr.dev/bounties/c958013b-1c09-4939-92ca-92f50aa169e8
Comment 1 Thomas Leroy 2021-10-21 08:56:56 UTC
Affected codestreams:
- SUSE:Carwos:1
- SUSE:SLE-11:Update
- SUSE:SLE-11-SP2:Update
- SUSE:SLE-12:Update
- SUSE:SLE-15:Update
Comment 2 Zoltan Balogh 2022-02-17 20:15:18 UTC
The bug can be reproduced with the poc provided with the 8.0 codebase from SLE15, but the upstream patch does eliminate the heap-based buffer overflow. After applying the patch the provided POC makes the vim hang. That is in my view a better problem as it is a functional and not a security issue.

The next upcoming MU will contain the patch. If there is a need we may offer a PTF for customers who need it.
Comment 4 Swamp Workflow Management 2022-03-04 17:18:40 UTC
SUSE-SU-2022:0736-1: An update that fixes 14 vulnerabilities is now available.

Category: security (important)
Bug References: 1190533,1190570,1191893,1192478,1192481,1193294,1193298,1194216,1194556,1195004,1195066,1195126,1195202,1195356
CVE References: CVE-2021-3778,CVE-2021-3796,CVE-2021-3872,CVE-2021-3927,CVE-2021-3928,CVE-2021-3984,CVE-2021-4019,CVE-2021-4193,CVE-2021-46059,CVE-2022-0318,CVE-2022-0319,CVE-2022-0351,CVE-2022-0361,CVE-2022-0413
JIRA References: 
Sources used:
SUSE Manager Server 4.1 (src):    vim-8.0.1568-5.17.1
SUSE Manager Retail Branch Server 4.1 (src):    vim-8.0.1568-5.17.1
SUSE Manager Proxy 4.1 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Server for SAP 15-SP2 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Server for SAP 15-SP1 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Server for SAP 15 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Server 15-SP2-LTSS (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Server 15-SP2-BCL (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Server 15-SP1-LTSS (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Server 15-SP1-BCL (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Server 15-LTSS (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Realtime Extension 15-SP2 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP4 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP3 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Module for Basesystem 15-SP4 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Module for Basesystem 15-SP3 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Micro 5.1 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise Micro 5.0 (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise High Performance Computing 15-SP2-LTSS (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise High Performance Computing 15-SP2-ESPOS (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise High Performance Computing 15-SP1-LTSS (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise High Performance Computing 15-SP1-ESPOS (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise High Performance Computing 15-LTSS (src):    vim-8.0.1568-5.17.1
SUSE Linux Enterprise High Performance Computing 15-ESPOS (src):    vim-8.0.1568-5.17.1
SUSE Enterprise Storage 7 (src):    vim-8.0.1568-5.17.1
SUSE Enterprise Storage 6 (src):    vim-8.0.1568-5.17.1
SUSE CaaS Platform 4.0 (src):    vim-8.0.1568-5.17.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 5 Swamp Workflow Management 2022-03-04 17:23:31 UTC
openSUSE-SU-2022:0736-1: An update that fixes 14 vulnerabilities is now available.

Category: security (important)
Bug References: 1190533,1190570,1191893,1192478,1192481,1193294,1193298,1194216,1194556,1195004,1195066,1195126,1195202,1195356
CVE References: CVE-2021-3778,CVE-2021-3796,CVE-2021-3872,CVE-2021-3927,CVE-2021-3928,CVE-2021-3984,CVE-2021-4019,CVE-2021-4193,CVE-2021-46059,CVE-2022-0318,CVE-2022-0319,CVE-2022-0351,CVE-2022-0361,CVE-2022-0413
JIRA References: 
Sources used:
openSUSE Leap 15.4 (src):    vim-8.0.1568-5.17.1
openSUSE Leap 15.3 (src):    vim-8.0.1568-5.17.1
Comment 6 Swamp Workflow Management 2022-04-19 22:27:38 UTC
SUSE-SU-2022:0736-2: An update that fixes 14 vulnerabilities is now available.

Category: security (important)
Bug References: 1190533,1190570,1191893,1192478,1192481,1193294,1193298,1194216,1194556,1195004,1195066,1195126,1195202,1195356
CVE References: CVE-2021-3778,CVE-2021-3796,CVE-2021-3872,CVE-2021-3927,CVE-2021-3928,CVE-2021-3984,CVE-2021-4019,CVE-2021-4193,CVE-2021-46059,CVE-2022-0318,CVE-2022-0319,CVE-2022-0351,CVE-2022-0361,CVE-2022-0413
JIRA References: 
Sources used:
SUSE Linux Enterprise Micro 5.2 (src):    vim-8.0.1568-5.17.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 7 Ali Abdallah 2022-05-18 12:47:16 UTC
Created attachment 859024 [details]
CVE-2021-3872 fix backported to vim 7.2 SLE11-SP2-Update

Backported CVE-2021-3872 upstream fix to SLE11-SP2-Update for PTF request of bug 1199666.