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-3705

CVE-2022-3705: Vim Use After Free Vulnerability

CVE-2022-3705 is a use after free vulnerability in Vim's quickfix.c affecting the qf_update_buffer function. Attackers can exploit this flaw remotely. This article covers technical details, affected versions, and mitigation.

Published: February 17, 2026

CVE-2022-3705 Overview

A use after free vulnerability was discovered in Vim, the ubiquitous text editor found on nearly every Unix-like system. The vulnerability exists in the qf_update_buffer function within the quickfix.c file, specifically in the autocmd Handler component. When triggered, this memory corruption flaw can be exploited remotely, potentially allowing an attacker to execute arbitrary code or cause denial of service conditions on affected systems.

Critical Impact

Remote attackers can exploit this use after free vulnerability through specially crafted files, potentially leading to arbitrary code execution or application crashes on systems running vulnerable Vim versions.

Affected Products

  • Vim versions prior to 9.0.0805
  • Fedora 35 and 36
  • Debian Linux 10.0
  • NetApp Active IQ Unified Manager for VMware vSphere

Discovery Timeline

  • 2022-10-26 - CVE-2022-3705 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-3705

Vulnerability Analysis

This vulnerability is classified as CWE-416 (Use After Free) and CWE-119 (Improper Restriction of Operations within the Bounds of a Memory Buffer). The flaw occurs when the quickfix buffer update mechanism fails to properly handle memory during autocmd (automatic command) execution. When a filetype autocmd is triggered during quickfix buffer operations, it can cause previously freed memory to be accessed, leading to undefined behavior.

The attack requires network access and user interaction, as the victim must open a maliciously crafted file. The complexity is elevated due to the specific conditions needed to trigger the vulnerability, but successful exploitation can result in complete compromise of confidentiality, integrity, and availability of the affected system.

Root Cause

The root cause stems from insufficient synchronization between the quickfix buffer operations and autocmd execution. When the qf_update_buffer function processes quickfix entries and an autocmd is triggered (such as a filetype detection autocmd), the function fails to increment the quickfix busy counter before calling aucmd_prepbuf(). This allows autocmds to modify or free the quickfix list while operations are still pending, resulting in subsequent access to freed memory.

Attack Vector

The attack is network-accessible, meaning an attacker can deliver a malicious file via email, web download, or network share. When a victim opens the crafted file in Vim, the following sequence occurs:

  1. Vim attempts to update the quickfix buffer with the file content
  2. A filetype autocmd is triggered during the buffer update
  3. The autocmd modifies the quickfix list, potentially freeing memory
  4. The qf_update_buffer function continues execution and accesses the freed memory
  5. This can lead to code execution if the attacker controls the freed memory contents
c
 	    qf_winid = win->w_id;
 	}

+	// autocommands may cause trouble
+	incr_quickfix_busy();
+
 	if (old_last == NULL)
 	    // set curwin/curbuf to buf and save a few things
 	    aucmd_prepbuf(&aco, buf);

Source: GitHub Commit d0fab10ed2

The patch adds a call to incr_quickfix_busy() before entering the autocmd preparation section, which prevents the quickfix list from being modified while operations are in progress.

Detection Methods for CVE-2022-3705

Indicators of Compromise

  • Unexpected Vim crashes when opening files with complex filetype detection rules
  • Memory corruption errors in system logs associated with vim processes
  • Unusual Vim process behavior including segmentation faults or abnormal termination

Detection Strategies

  • Monitor for Vim process crashes or segmentation faults in system logs
  • Implement file integrity monitoring on vim binaries to detect unauthorized modifications
  • Use memory sanitizer tools (ASan, MSan) during development to detect use-after-free conditions
  • Review autocmd configurations for suspicious or unexpected commands

Monitoring Recommendations

  • Enable core dump collection for Vim processes to aid in post-incident analysis
  • Configure centralized logging to capture Vim crash events across the environment
  • Implement endpoint detection rules to alert on patterns consistent with Vim memory corruption exploits

How to Mitigate CVE-2022-3705

Immediate Actions Required

  • Upgrade Vim to version 9.0.0805 or later immediately
  • Apply vendor-specific security updates from Fedora, Debian, or NetApp as applicable
  • Review and restrict autocmd configurations in .vimrc files to minimize attack surface
  • Educate users about the risks of opening untrusted files in Vim

Patch Information

The vulnerability is addressed in Vim version 9.0.0805. The fix is available in commit d0fab10ed2a86698937e3c3fed2f10bd9bb5e731. Multiple vendors have released security updates:

  • Debian has released updates via Debian LTS Security Announcement
  • Fedora has released package updates for Fedora 35 and 36
  • Gentoo has released GLSA 2023-05-16
  • NetApp has released an advisory via NetApp Security Advisory
  • Apple has addressed this in macOS updates per Apple Security Update Notice

Workarounds

  • Disable autocmds temporarily by launching Vim with vim -u NONE to load without vimrc
  • Restrict the use of filetype detection by adding filetype off to .vimrc
  • Avoid opening files from untrusted sources in Vim until patched
  • Consider using alternative text editors for reviewing untrusted files
bash
# Check current Vim version
vim --version | head -1

# Update Vim on Debian/Ubuntu
sudo apt update && sudo apt install vim

# Update Vim on Fedora
sudo dnf update vim

# Launch Vim without loading any configuration (temporary workaround)
vim -u NONE -N

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.5

  • EPSS Probability0.38%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-119

  • CWE-416
  • Technical References
  • Full Disclosure Announcement

  • Debian LTS Security Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA 2023-05-16

  • NetApp Security Advisory

  • Apple Security Update Notice

  • VulDB #212324
  • Vendor Resources
  • GitHub Commit d0fab10ed2
  • 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