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
    • 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-2023-4750

CVE-2023-4750: Vim Use After Free Vulnerability

CVE-2023-4750 is a use after free vulnerability in Vim that affects versions prior to 9.0.1857 and could lead to memory corruption. This post covers technical details, affected versions, security impact, and mitigation.

Published: February 4, 2026

CVE-2023-4750 Overview

CVE-2023-4750 is a Use After Free vulnerability affecting Vim, the popular text editor, in versions prior to 9.0.1857. This memory corruption flaw occurs specifically in the is_qf_win() function within the quickfix functionality, where a heap-use-after-free condition can be triggered. The vulnerability requires local access and user interaction, but successful exploitation can lead to arbitrary code execution with the privileges of the user running Vim.

Critical Impact

Attackers exploiting this vulnerability can achieve arbitrary code execution, potentially leading to full system compromise depending on the privileges of the Vim process. The vulnerability affects confidentiality, integrity, and availability of the system.

Affected Products

  • Vim versions prior to 9.0.1857
  • Fedora 37, 38, and 39
  • Apple macOS (various versions)

Discovery Timeline

  • 2023-09-04 - CVE-2023-4750 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-4750

Vulnerability Analysis

This Use After Free vulnerability resides in Vim's quickfix window handling code. The flaw occurs when the is_qf_win() function in src/quickfix.c accesses a window's buffer without first validating that the buffer reference is still valid. During certain autocommand sequences, a buffer can be closed while windows still maintain references to it, creating a dangling pointer situation. When the quickfix-related code subsequently accesses this freed buffer memory, it results in a heap-use-after-free condition.

The vulnerability was discovered and reported through the Huntr bug bounty platform. The issue specifically affects how Vim handles buffer validity checks when iterating through windows in tab pages and when determining if a window is displaying quickfix content.

Root Cause

The root cause is inadequate buffer validity checking in two critical locations within the Vim codebase. In src/main.c, the code iterated through windows and checked only if wp->w_buffer == NULL, but failed to verify that the buffer was still valid using buf_valid(). Similarly, in src/quickfix.c, the is_qf_win() function accessed win->w_buffer properties without first confirming the buffer's validity. Autocommands can close buffers during certain operations, but the window structures may retain stale pointers to the freed buffer memory.

Attack Vector

The attack requires local access to the target system and user interaction to trigger. An attacker must craft a malicious Vim file or script that exploits the autocommand mechanism to trigger the use-after-free condition. When a user opens the malicious file or executes the crafted script, the vulnerability can be triggered during quickfix window operations. The attacker can potentially achieve arbitrary code execution by manipulating the freed heap memory before it is accessed.

The following patches demonstrate the fix applied to address this vulnerability:

Patch in src/main.c:

c
 	    next_tp = tp->tp_next;
 	    FOR_ALL_WINDOWS_IN_TAB(tp, wp)
 	    {
-		if (wp->w_buffer == NULL)
+		if (wp->w_buffer == NULL || !buf_valid(wp->w_buffer))
 		    // Autocmd must have close the buffer already, skip.
 		    continue;
 		buf = wp->w_buffer;

Source: GitHub Vim Commit Update

Patch in src/quickfix.c:

c
    // set to NULL.
    // A window displaying a location list buffer will have the w_llist_ref
    // pointing to the location list.
-    if (bt_quickfix(win->w_buffer))
+    if (buf_valid(win->w_buffer) && bt_quickfix(win->w_buffer))
 	if ((IS_QF_STACK(qi) && win->w_llist_ref == NULL)
 		|| (IS_LL_STACK(qi) && win->w_llist_ref == qi))
 	    return TRUE;

Source: GitHub Vim Commit Update

Detection Methods for CVE-2023-4750

Indicators of Compromise

  • Unexpected Vim crashes or segmentation faults during quickfix window operations
  • Suspicious Vim script files or modelines that trigger autocommands manipulating buffers
  • Abnormal memory access patterns in Vim processes detected by memory sanitizers
  • Vim process spawning unexpected child processes or making unusual system calls

Detection Strategies

  • Monitor for Vim processes exhibiting abnormal behavior such as crashes followed by unusual process execution
  • Deploy memory safety tools (AddressSanitizer, Valgrind) in development and testing environments to detect use-after-free conditions
  • Implement file integrity monitoring for Vim configuration files and scripts
  • Use endpoint detection and response (EDR) solutions to monitor for exploit chains targeting text editors

Monitoring Recommendations

  • Enable crash reporting and analysis for Vim processes across the organization
  • Monitor system logs for patterns indicating exploitation attempts through Vim
  • Track Vim version deployments and ensure timely updates to patched versions
  • Implement SentinelOne's behavioral AI to detect post-exploitation activities that may follow successful memory corruption exploitation

How to Mitigate CVE-2023-4750

Immediate Actions Required

  • Upgrade Vim to version 9.0.1857 or later immediately
  • Apply vendor-provided security patches for Fedora 37, 38, and 39 systems
  • Update macOS to the latest security release as referenced in Apple Support Article HT213984
  • Audit systems for outdated Vim installations and prioritize remediation

Patch Information

The vulnerability has been addressed in Vim version 9.0.1857 through commit fc68299d436cf87453e432daa77b6d545df4d7ed. The fix adds proper buffer validity checks using the buf_valid() function before accessing buffer properties in both src/main.c and src/quickfix.c.

Patched packages are available through:

  • Official Vim GitHub Repository
  • Fedora Package Announcements
  • Apple macOS Security Updates

Workarounds

  • Restrict execution of untrusted Vim scripts and modelines by adding set nomodeline to your vimrc configuration
  • Avoid opening files from untrusted sources in Vim until patching is complete
  • Consider using alternative text editors temporarily for handling untrusted content
  • Implement strict application control policies to limit Vim execution contexts
bash
# Configuration example - Add to ~/.vimrc to disable modelines
set nomodeline
set modelines=0

# Verify Vim version to ensure patched version is installed
vim --version | head -n 1
# Should show: VIM - Vi IMproved 9.0 (patch 1857 or higher)

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.04%

  • 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
  • Full Disclosure Mailing List

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Apple Support Article
  • Vendor Resources
  • GitHub Vim Commit Update

  • 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-2024-41965: 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