CVE-2025-55158 Vim double-free vulnerability during Vim9 script import operations

Medium 6.9 Published Updated

A double-free vulnerability in Vim allows attackers to execute arbitrary code or cause a crash by tricking users into opening a malicious Vim script.

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

What is CVE-2025-55158?

CVE-2025-55158 is a medium-severity use after free vulnerability in Vim Vim, published on 11 Aug 2025. 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

Vim is an open source, command line text editor. In versions from 9.1.1231 to before 9.1.1406, when processing nested tuples during Vim9 script import operations, an error during evaluation can trigger a double-free in Vim’s internal typed value (typval_T) management. Specifically, the clear_tv() function may attempt to free memory that has already been deallocated, due to improper lifetime handling in the handle_import / ex_import code paths. The vulnerability can only be triggered if a user explicitly opens and executes a specially crafted Vim script. This issue has been patched in version 9.1.1406.

Weakness: CWE-415

Which versions are affected by CVE-2025-55158?

It affects 1 product.

Products include Vim Vim.

How do I fix CVE-2025-55158?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-55158 being exploited?

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

All Vim Vim vulnerabilities

Sources

Also known as BELL-CVE-2025-55158, GHSA-5fg8-wvx3-583x.

Is CVE-2025-55158 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free