Critical Use After Free Vulnerability in Vim Package

vim Updated 02 Oct 2025

Summary

15/09/2021
N/A
Yes i
High
7.3

UBUNTU-CVE-2021-3796: vim is vulnerable to Use After Free. Affects vim versions < 2:7.4.052-1ubuntu3.1+esm3. Fixed in 2:7.4.052-1ubuntu3.1+esm3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Vim is a highly configurable text editor built to enable efficient text editing. It is widely used by programmers and system administrators for its powerful features and extensibility. However, it has been found to be vulnerable to a Use After Free issue, which can lead to potential exploitation if not addressed promptly.

Vulnerability Detail

The vulnerability identified as CVE-2021-3796 in the Vim package arises from a Use After Free condition. This occurs when the program continues to use a memory reference after it has been freed, leading to unpredictable behavior, crashes, or even arbitrary code execution. The severity of this vulnerability is underscored by its CVSS score of 7.3, indicating a high risk to systems utilizing affected versions of Vim.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm3

This is the first release that contains the fix.

sudo apt-get install --only-upgrade vim

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid using features of Vim that may trigger the vulnerability until they can apply the patch. It is advisable to limit the use of plugins or scripts that interact with memory management until the update is completed.

Conclusion

The Use After Free vulnerability in the Vim package poses significant risks to users, with potential for exploitation if not addressed. It is crucial to update to the latest patched versions to mitigate these risks. Users can also utilize tools like Vulert to monitor for vulnerabilities in their applications effectively.

See every vulnerability recorded for vim →

Share this vulnerability

FAQ

CVE-2021-3796 is a vulnerability in the Vim text editor that allows for a Use After Free condition, potentially leading to crashes or arbitrary code execution.

You can check your version of Vim by running 'vim --version' in your terminal. Compare it against the affected versions listed in the vulnerability report.

If an immediate update is not possible, consider limiting the use of Vim or disabling any plugins that may exacerbate the vulnerability until a patch can be applied.

More information can be found in the official Ubuntu security notices or by visiting the CVE database.

Vulert monitors open-source vulnerabilities in your software using a manifest file like package-lock.json, providing real-time alerts without requiring code access or installation.

Related vulnerabilities

Recent vulnerabilities recorded for vim.

How To Fix

Minimum fixed version

2:7.4.052-1ubuntu3.1+esm3

This is the first release that contains the fix.

sudo apt-get install --only-upgrade vim

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback