The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2022-1154

CVE-2022-1154: Vim Use After Free Vulnerability

CVE-2022-1154 is a use after free vulnerability in Vim's utf_ptr2char function affecting versions prior to 8.2.4646. This flaw can lead to memory corruption and potential code execution. This article covers the vulnerability's technical details, affected versions, impact assessment, and mitigation strategies.

Published: February 11, 2026

CVE-2022-1154 Overview

CVE-2022-1154 is a use after free vulnerability in the utf_ptr2char function in Vim, the popular text editor. This memory corruption flaw exists in versions prior to 8.2.4646 and can be triggered when processing maliciously crafted input, potentially leading to arbitrary code execution or denial of service on affected systems.

Critical Impact

This use after free vulnerability allows attackers to potentially execute arbitrary code with the privileges of the user running Vim, compromise system integrity, or cause application crashes through memory corruption.

Affected Products

  • Vim versions prior to 8.2.4646
  • Fedora 34 and 35
  • Debian Linux 9.0 and 10.0
  • Oracle Communications Cloud Native Core Network Exposure Function 22.1.1

Discovery Timeline

  • March 30, 2022 - CVE-2022-1154 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2022-1154

Vulnerability Analysis

The vulnerability exists in Vim's regular expression engine, specifically in the src/regexp_bt.c file. The flaw occurs when processing buffer lines during regex operations involving marks. When getmark_buf() is called to retrieve a mark position, the function may free and reallocate the current buffer line, but the code continues to reference the old (now freed) memory location through rex.line and rex.input pointers.

This use after free condition (CWE-416) creates a dangerous situation where subsequent operations access memory that has been deallocated and potentially reused for other purposes. An attacker who can control input processed by Vim's regex engine could craft malicious content that triggers this condition, potentially achieving code execution or causing the application to crash.

Root Cause

The root cause lies in the regexp backtracking code's failure to refresh buffer line pointers after operations that may invalidate them. When getmark_buf() is invoked, it can trigger memory operations that free the current line buffer. The code did not account for this scenario and continued using stale pointers to the freed memory region.

Attack Vector

The attack requires local access and user interaction—a victim must open a specially crafted file or execute a Vim command that triggers the vulnerable regex pattern matching code path. While the attack complexity is low once the conditions are met, the local attack vector and user interaction requirement limit exposure compared to remotely exploitable vulnerabilities.

The following patch from commit b55986c52d4cd88a22d0b0b0e8a79547ba13e1d5 demonstrates the fix:

c
 		int	mark = OPERAND(scan)[0];
 		int	cmp = OPERAND(scan)[1];
 		pos_T	*pos;
+		size_t	col = REG_MULTI ? rex.input - rex.line : 0;
 
 		pos = getmark_buf(rex.reg_buf, mark, FALSE);
+
+		// Line may have been freed, get it again.
+		if (REG_MULTI)
+		{
+		    rex.line = reg_getline(rex.lnum);
+		    rex.input = rex.line + col;
+		}
+
 		if (pos == NULL		     // mark doesn't exist
 			|| pos->lnum <= 0)   // mark isn't set in reg_buf
 		{

Source: GitHub Commit b55986c5

The patch stores the current column position before calling getmark_buf(), then refreshes the rex.line pointer by calling reg_getline() and recalculates rex.input to point to the correct position in the newly fetched line buffer.

Detection Methods for CVE-2022-1154

Indicators of Compromise

  • Unexpected Vim crashes or segmentation faults during file operations
  • Anomalous memory access patterns in Vim processes when processing regex patterns
  • Core dumps from Vim showing memory corruption signatures in regexp-related functions

Detection Strategies

  • Monitor for Vim process crashes with memory corruption indicators in system logs
  • Implement file integrity monitoring on systems where Vim is used to edit sensitive files
  • Deploy endpoint detection solutions that can identify use after free exploitation attempts

Monitoring Recommendations

  • Track Vim version deployments across your environment to identify vulnerable installations
  • Monitor for suspicious files with complex regex patterns that could trigger the vulnerability
  • Enable crash reporting and analysis for Vim processes to detect potential exploitation attempts

How to Mitigate CVE-2022-1154

Immediate Actions Required

  • Update Vim to version 8.2.4646 or later immediately
  • Apply vendor-provided patches from your Linux distribution's package manager
  • Consider restricting Vim usage on sensitive systems until patching is complete
  • Review any files from untrusted sources before opening in Vim

Patch Information

The vulnerability was fixed in Vim version 8.2.4646. The official patch is available through the GitHub commit b55986c52d4cd88a22d0b0b0e8a79547ba13e1d5. Multiple Linux distributions have released security updates:

  • Fedora users should apply updates via the Fedora Package Announcements
  • Debian users can reference the Debian LTS Security Advisories
  • Gentoo users should consult GLSA 202208-32
  • Oracle customers should review the Oracle Security Alert July 2022

Workarounds

  • Use alternative text editors for processing untrusted files until Vim can be updated
  • Avoid opening files from untrusted sources in vulnerable Vim versions
  • Consider running Vim in restricted mode when editing potentially malicious content
  • Implement application sandboxing to limit the impact of potential exploitation
bash
# Update Vim on Debian/Ubuntu
sudo apt update && sudo apt upgrade vim

# Update Vim on Fedora
sudo dnf update vim

# Update Vim on Gentoo
sudo emerge --sync && sudo emerge -av app-editors/vim

# Verify Vim version after update
vim --version | head -1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechVim

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability0.60%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-416
  • Technical References
  • Debian LTS Advisory May 2022

  • Debian LTS Advisory November 2022

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA 2022-08-32

  • Gentoo GLSA 2023-05-16

  • Oracle Security Alert July 2022
  • Vendor Resources
  • GitHub Commit Change

  • Huntr Bounty Report
  • Related CVEs
  • CVE-2024-41957: Vim Use-After-Free Vulnerability

  • CVE-2025-26603: Vim Use-After-Free Vulnerability

  • CVE-2025-24014: Vim Use-After-Free Vulnerability

  • CVE-2025-55157: Vim Use-After-Free Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English