News

Vulnerability in Vim and Neovim editors leads to code execution while opening a malicious file

In text editors Vim and Neovim was found a vulnerability (CVE-2019-12735), which allows to execute arbitrary code while opening a specially designed file.

The problem manifests itself with the activity of the modeline enabled by default (“: set modeline“), which allows defining editing options in the file being processed. Vulnerability eliminated in Vim 8.1.1365 and Neovim 0.3.6 releases.

Through modeline, allowed only a limited number of options. If expression is specified as an option value, it is executed in the sandbox mode, which allows using only the simplest safe operations.

At the same time, the “: source” command is and in it can be used “!” Modifier to run arbitrary commands from specified file. Thus, to execute the code, it is sufficient to indicate in the modeline line a construction of the form “set foldexpr = execute (‘\: source! Some_file’):“. In Neovim, execute call is forbidden, but assert_fails can be used instead.

For example, to execute “uname -a” command, simply open a file in Vim or Neovim, the first or last line of which says:

:!uname -a||" vi:fen:fdm=expr:fde=assert_fails("source\!\ \%"):fdl=0:fdt="

The “source!%” comand will read commands from the current file and, accordingly, execute “:! Uname -a“. To hide this line from output by the cat utility, can be used escape sequences.

For example, in this prototype of an exploit during operation of a file in vim, created network connection with shell access to victim’s system, but this file will not cause suspicion when outputting to the terminal with the cat utility.

You can check the modeline activity using the “: set modeline?” Command. To disable vimrc, you can add the line “set nomodeline“. In distributions, the problem is fixed in RHEL, SUSE/openSUSE, Fedora, FreeBSD, Ubuntu, Arch Linux and ALT. Vulnerability remains uncorrected in Debian.

Source: https://nvd.nist.gov

Polina Lisovskaya

I works as a marketing manager for years now and loves searching for interesting topics for you

Recent Posts

Remove Pbmsoultions.com Pop-up Ads

About Pbmsoultions.com Pbmsoultions.com pop-ups can not launch out of the blue. If you have actually…

19 hours ago

Remove Prizestash.com Pop-up Ads

About Prizestash.com Prizestash.com pop-ups can not expose out of the blue. If you have actually…

19 hours ago

Remove Verifiedbreaking.com Pop-up Ads

About Verifiedbreaking.com Verifiedbreaking.com pop-ups can not launch out of nowhere. If you have actually clicked…

19 hours ago

Remove Themoneyminutes.com Pop-up Ads

About Themoneyminutes.com Themoneyminutes.com pop-ups can not launch out of the blue. If you have actually…

20 hours ago

Remove News-xcidizi.com Pop-up Ads

About News-xcidizi.com News-xcidizi.com pop-ups can not introduce out of nowhere. If you have clicked some…

23 hours ago

Remove Everytraffic-flow.com Pop-up Ads

About Everytraffic-flow.com Everytraffic-flow.com pop-ups can not launch out of nowhere. If you have actually clicked…

23 hours ago