r/vim • • Nov 13 '15

Your Text Editor Is Malware

https://glyph.twistedmatrix.com/2015/11/editor-malware.html
0 Upvotes

45 comments sorted by

26

u/mlmcmillion Nov 13 '15

HTTPS is a step up, sure, but that still gives you no guarantee that what you're installing is safe.

3

u/SgtSgr Nov 13 '15

I'm using Vim more for creative stuff, so I'm kind of a non-techie lurker who sometimes manages code, but I was kinda wondering about that as I was reading it -- how exactly does https prevent malicious code in a plugin?

Also, would it be more secure if you simply turned off all the outside programming languages? Or is it just as possible to write malicious code in Vimscript?

Thinking about it, I guess the answer to that would be 'yes', wouldn't it?

0

u/[deleted] Nov 13 '15

[deleted]

5

u/mlmcmillion Nov 13 '15

Right. In fact the chances of that happening are probably far less than you just downloading actual malicious code. Which doing so over HTTPS won't prevent.

1

u/wbsgrepit Nov 15 '15

Not really, it is a vector just the same. Both require mitigation but it is not unlikely or even challenging to MITM vim specific users at a starbucks in sf or nyc if you create a fake and overpowered ATT SSID network and sit there for an afternoon as a MITM bridge.

You do not need to dynamically inject exploit code in this case -- just drop a replacement project that has a simple exec in the viml. I would say if you do not have good security hygiene this type of exploit is actually much more likely than tpope's account being stolen or tpope injecting some sploit in his plugins for instance.

It is about risk and reward -- if you are after keys to the castle for a 100MM user startup what seems like a better vector to you than sitting in the nearest coffee shop to the dev office?

Beyond an injection like this on vim you can easily make one that covers vim/emacs/atom/sublime/tmate plugins as well as oter common vectors like webmail/imap logins. With iphones and certain carrier andriod pushes that SSID will be autojoined by those cell phones as well by default.

2

u/SgtSgr Nov 13 '15

Thnx, wasn't even looking at it that way. Was thinking more about the intent of the person posting the code in the first place.

7

u/gumnos Nov 13 '15

Wanna stay safe? Use ed(1) which doesn't use plugins. Even better, use red(1) for increased security. 😉

6

u/hidroto Nov 13 '15

3

u/gumnos Nov 13 '15

When I use an editor, I don't want eight extra KILOBYTES of worthless help screens and cursor positioning code! I just want an EDitor!! Not a “viitor”. Not a “emacsitor”. Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!!

Come to think of it, "sublimeitor", "nanoitor", "notepad++itor" aren't words either.

-1

u/rvndps Nov 13 '15

Or notepad!

1

u/[deleted] Nov 14 '15

Standard on Windows server since forever, can't deny how useful it has been in its limited capacity.

8

u/[deleted] Nov 13 '15

I guess I'm the only person that doesn't install extra stuff for Vim. I barely even have a vimrc because I want to be comfortable with as close to defaults as I can be.

3

u/rvndps Nov 13 '15

U can count me in. I use only colors. Longtime, I am thinking about the credibility of a plugin. It is mostly about the popularity of the plugin. This is the first time I am seeing someone talking about this.

6

u/gumnos Nov 13 '15

I'm with you. My .vimrc fits in a 140-character tweet with room to spare (mostly some knob-twiddling about 'shiftwidth', 'tabstop', 'expandtab', and syntax coloring.) Mostly because I move around between so many machines and reformat so many of them that it's not really worth trying to keep them all in sync.

5

u/vim_viking Nov 13 '15

Do you also not use Vim's extensive documentation because you'd rather figure things out by yourself?

Do yourself a favor and start using the full power of vim. If you've really learned Vim you won't forget the defaults.

8

u/[deleted] Nov 13 '15

Do you also not use Vim's extensive documentation because you'd rather figure things out by yourself?

This isn't even a reasonable comparison. Figuring things out without docs is a ton of guesswork, while using vim without plugins is, at most, a few more keystrokes. Also, documentation usually comes with the program and/or is usually installed by default, while plugins have to be installed separately.

2

u/vim_viking Nov 13 '15

Yes, but it's a few extra keystrokes each time, which means tons of extra keystrokes. It's kind of the point of Vim - maybe the difference between an injury or none. I'm talking about your nearly empty vimrc.

3

u/[deleted] Nov 13 '15

It seems my needs are pretty simple, then. Very rarely do I need to do something in Vim and think of it as particularly tedious.

1

u/vim_viking Nov 13 '15

That's true - I was just trying to ram the point home. Sorry if that came across without the tinge of humor I intended.

2

u/-romainl- The Patient Vimmer Nov 13 '15

You don't need a vimrc or shitloads of plugins to use "the full power of vim". Quite the opposite, actually.

2

u/[deleted] Nov 13 '15

Same.

Both my vim and shell dotfiles are either stuff that I've written, or they're stuff that I've read and manually installed. (Or generated by a built-in tool in the case of zsh).

I don't really need 20 plugins in order to use vim well enough for my needs, I'm not interested in "oh I can do function X in only 5 keystrokes", because the editor is not really the bottleneck at this point, it's just my thinking speed because I have to think about what I'm doing.

2

u/[deleted] Nov 13 '15

Same here. Vanilla vim. Tried a couple of plugins, but didn't like them.

1

u/j_lyf Nov 13 '15

What about Ctrl-P?

3

u/[deleted] Nov 13 '15

Nope. I use plain old grep and find.

1

u/j_lyf Nov 13 '15

Do you have aliases at least?

1

u/[deleted] Nov 13 '15

I don't, but mostly because I haven't bothered to alias the two things I can think of that would actually be worthwhile for me to alias. The other somewhat complex things I use are either too infrequently used or too specific to make an alias useful.

1

u/gumnos Nov 13 '15

By "alias", do you mean mappings or abbreviations? I have a couple machine-specific mappings for a given project, but by no means haul those around between the multitude of machines on which I work. I only use abbreviations when I'm working on prose and usually establish those as I encounter them as annoying-to-type (usually business-names or official document names like "Dunning & Slatherton"). They don't live past the individual editing session.

1

u/marklgr vimgor: good bot Nov 13 '15 edited Nov 13 '15

"Plugins are so mainstream" -- A vimpster.

Edit: downvoted because of the snark I guess. Now, "vimpster" was not just not taking a dig, I really believe there is a trend lately about announcing proudly that you don't use plugins or that you have a very short vimrc, even if it is slightly off-topic--like here, arguably.

1

u/vim_viking Nov 14 '15

Wow, I'm a fan; this is very astute.

1

u/[deleted] Nov 14 '15 edited Nov 14 '15

I do not, in fact, refuse to use plugins because they're "mainstream" or anything ridiculous like that. I simply haven't found a use case and I like being able to just jump into a system and be comfortable.

1

u/marklgr vimgor: good bot Nov 15 '15

That was a joke, mate, hipster-vimpster. But like I said, I still find it slightly off-topic to post in a security-related thread that your particular usage does not involve plugins. No offense, but what does it bring to the discussion?

1

u/[deleted] Nov 15 '15

Admittedly, it doesn't bring too much into the conversation. I wanted to express the idea that running vim without plugins is not a huge hinderance. Also, I just never seen anyone say that before and was mildly curious about whether other users here feel the same way.

I'm sorry, I'm terrible at figuring out whether someone is joking or not.

2

u/marklgr vimgor: good bot Nov 16 '15

No big deal, I wasn't picking on you personnally--and it was light-hearted banter anyway. If you stay along here for some time, you'll probably notice trends, like the no-plugins-short-vimrc one, people bringing spacemacs into conversation, or the everlasting "How do I turn vim into a full IDE?".

0

u/[deleted] Nov 13 '15

[deleted]

5

u/wherethebuffaloroam Nov 13 '15

The reasoning bring that if you are logged into multiple machines over a day that getting used to anything but the defaults is counter productive

0

u/[deleted] Nov 13 '15

[deleted]

3

u/wherethebuffaloroam Nov 13 '15

I'm assuming this situation could be hundreds of machines with many different users. It can get annoying, especially if there are plugins required. It can be nontrivial and it might not even have a big payout or increase productivity

0

u/[deleted] Nov 13 '15

[deleted]

1

u/wherethebuffaloroam Nov 13 '15

Probably not. If you're a programmer you'll usually have your development environment so carry on and its largely static. If you are a sysadmin then you might be ssh-ing into tons of machines and carrying over files gets tedious

3

u/chreekat Nov 13 '15

When you're only popping into a system for a few minutes to tweak a couple files, but you repeat that process for umpteen oft-changing or just-instantiated systems, it's so much nicer to just be comfortable with the vim defaults. They're really quite usable anyway.

2

u/[deleted] Nov 13 '15 edited Nov 13 '15

Because the defaults are everywhere. When I use other computers, I don't have to spend a lot of time setting up, and I can just whip up my vimrc from memory if I really need to.

2

u/BowserKoopa Nov 13 '15

This is one stupid fucking "article". Why?

  1. Blog spam

  2. Edgy title

  3. Premise of the article is low-hanging fruit

  4. Premise is turbo-paranoid. Sure, fetching packages over plaintext is suboptimal, but slow down and ask your self, "who the hell is going to tamper with my syntax highlighting script?"

  5. This didn't need to be any more than one paragraph at most.

1

u/rvndps Nov 14 '15

He has a point, 'worry about what, where and how you get your plugins'

1

u/BowserKoopa Nov 14 '15

Which is perfectly valid. That being said, It's a little odd that he is focusing on specifically text editors. Firstly, all of the text editors that I use, including vim, require that plugins be installed with use assistance (I use pathogen), which means that if you are making an unsafe connection, you will know it. Secondly, as I mentioned, this article really should be why you should avoid running code you got from insecure connections. That being said, I have yet to see Vim Malware, and I doubt anyone is going to go very far to produce any unless they have a very specific target in mind. Emacs is a better attack vector IMO as elisp is a far more capable language than viml (though I still prefer vim).

2

u/ShougoMatsu Dark Vim Master / 暗黒美夢王(Uncock Vim Awe) Nov 15 '15

I have implemented enforce https or ssh feature in neobundle. You cannot use unsecure protocols in neobundle. https://github.com/Shougo/neobundle.vim/pull/448

-2

u/Fmorris Nov 13 '15

Emacs: good malware that still lacks a proper text editor.

-1

u/olmu1944 Vim Diesel (xXx) Nov 13 '15

There VIM users that also use Emacs.