Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2023-5535

CVE-2023-5535: Vim Use After Free Vulnerability

CVE-2023-5535 is a use after free vulnerability in Vim text editor that could allow attackers to exploit memory corruption. This article covers the technical details, affected versions, potential impact, and mitigation.

Published: February 4, 2026

CVE-2023-5535 Overview

CVE-2023-5535 is a Use After Free vulnerability affecting Vim, the popular text editor, in versions prior to v9.0.2010. This memory corruption flaw occurs in the buf_contents_changed() function, where autocommands can trigger buffer modifications leading to use-after-free conditions. An attacker who can entice a user to open a specially crafted file may be able to exploit this vulnerability to execute arbitrary code in the context of the affected process.

Critical Impact

This vulnerability allows local attackers to potentially achieve arbitrary code execution by exploiting a use-after-free condition triggered through malicious file handling. Successful exploitation requires user interaction but can result in complete compromise of confidentiality, integrity, and availability.

Affected Products

  • Vim versions prior to 9.0.2010
  • Fedora 37
  • Fedora 38
  • Fedora 39

Discovery Timeline

  • 2023-10-11 - CVE-2023-5535 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2023-5535

Vulnerability Analysis

This Use After Free vulnerability exists within Vim's buffer handling code, specifically in the buf_contents_changed() function located in src/buffer.c. The core issue stems from improper handling of autocommands during buffer operations, which can trigger unexpected side effects such as wiping buffers while they are still being referenced.

When Vim processes certain buffer operations, autocommands may execute and modify or free buffer memory that is still in use by the calling function. After the autocommand completes, the original code continues to access memory that has been freed, creating a classic use-after-free scenario that can lead to memory corruption and potential code execution.

The attack requires local access and user interaction, meaning a victim must be convinced to open a maliciously crafted file that triggers the vulnerable code path.

Root Cause

The root cause is the failure to properly block autocommands before performing buffer operations in buf_contents_changed(). Autocommands in Vim are powerful hooks that execute automatically in response to certain events, but they can have "nasty side-effects like wiping buffers" as noted in the patch comments. Without blocking these autocommands, a race condition exists where buffer memory can be freed by an autocommand while still being accessed by the parent function, resulting in use-after-free.

Attack Vector

The attack vector is local, requiring an attacker to craft a malicious file that, when opened in Vim, triggers autocommands during buffer content checking operations. The attacker would need to:

  1. Create a file with specially crafted content or associated autocommands
  2. Convince a user to open this file in a vulnerable version of Vim
  3. Trigger the buf_contents_changed() function with conditions that allow autocommands to free the buffer
  4. Leverage the resulting use-after-free condition for code execution or denial of service
c
// Security patch from src/buffer.c
// Source: https://github.com/vim/vim/commit/41e6f7d6ba67b61d911f9b1d76325cd79224753d

 	return TRUE;
    }

+    // We don't want to trigger autocommands now, they may have nasty
+    // side-effects like wiping buffers
+    block_autocmds();
    if (ml_open(curbuf) == OK
	    && readfile(buf->b_ffname, buf->b_fname,
				  (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM,

The patch adds a call to block_autocmds() before performing buffer operations, preventing autocommands from executing during this critical section and eliminating the use-after-free condition.

Detection Methods for CVE-2023-5535

Indicators of Compromise

  • Unexpected Vim crashes or segmentation faults when opening files
  • Core dumps from Vim processes indicating memory corruption
  • Suspicious files with unusual autocommand configurations in user directories
  • Evidence of exploitation attempts in system logs showing Vim process anomalies

Detection Strategies

  • Monitor for Vim process crashes with memory corruption signatures using system monitoring tools
  • Implement file integrity monitoring for Vim configuration files (.vimrc, autoload scripts)
  • Deploy endpoint detection rules to identify suspicious file patterns designed to trigger autocommand abuse
  • Use memory safety tools (ASan, Valgrind) during development to detect use-after-free conditions

Monitoring Recommendations

  • Enable core dump collection and analysis for Vim processes on critical systems
  • Monitor for unusual Vim process behavior including unexpected child processes or network connections
  • Review Vim configuration files for potentially malicious autocommand definitions
  • Track Vim version deployment across infrastructure to ensure patched versions are in use

How to Mitigate CVE-2023-5535

Immediate Actions Required

  • Update Vim to version 9.0.2010 or later immediately
  • Apply security updates from your Linux distribution's package manager
  • Advise users to avoid opening untrusted files in Vim until patched
  • Review and audit any custom Vim autocommand configurations for suspicious entries

Patch Information

The vulnerability has been addressed in Vim version 9.0.2010. The fix adds proper autocommand blocking before buffer operations to prevent the use-after-free condition. The security patch is available in the GitHub Vim Commit.

Distribution-specific updates are available:

  • Fedora users should apply updates via Fedora Package Announcements

For additional details, see the Huntr Vulnerability Bounty report.

Workarounds

  • Disable autocommands when opening untrusted files by launching Vim with vim -u NONE flag
  • Use the --noplugin flag to prevent plugin-based autocommands from loading
  • Configure Vim to prompt before executing autocommands from untrusted sources
  • Consider using alternative text editors for reviewing untrusted files until Vim is updated
bash
# Configuration example
# Update Vim on Fedora-based systems
sudo dnf update vim-enhanced vim-common

# Update Vim on Debian/Ubuntu-based systems
sudo apt update && sudo apt upgrade vim

# Verify installed Vim version
vim --version | head -1
# Should show version 9.0.2010 or higher

# Launch Vim without autocommands for untrusted files (workaround)
vim -u NONE --noplugin untrusted_file.txt

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

  • 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
  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement
  • Vendor Resources
  • GitHub Vim Commit Update

  • Huntr Vulnerability Bounty
  • 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