Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure Modelines #27

Open
voyeg3r opened this issue Jul 24, 2021 · 1 comment
Open

Secure Modelines #27

voyeg3r opened this issue Jul 24, 2021 · 1 comment
Labels
help wanted Extra attention is needed idea

Comments

@voyeg3r
Copy link

voyeg3r commented Jul 24, 2021

What?
Once in a while, modelines appear in articles about security issues. Vim has a plugin called securemodelines to avoid these issues.

Why?
The plugin should only use some options in modelines, those that do not bring any risk to our systems. It uses a variable called "secure_modelines_allowed_items".

Potential existing implementations:
There is at least one vim version of secure modelines tlvince/securemodelines

Potential pitfalls:
I never have developed any vim plugin, now with many Lua plugins coming out I intend to study the help the community

@voyeg3r voyeg3r added help wanted Extra attention is needed idea labels Jul 24, 2021
@matu3ba
Copy link

matu3ba commented Sep 29, 2021

Can you explain in simple words how the modelines works? As I understand, modlines set file-specific settings that can be taken from a repository onto some file formats (cause you dont trust the repository).

How does this relate to the file content? Does (neo)vim automatically read (very unsafely) settings from the current repo?
How does this prevent accidental opening vim/neovim with the wrong flags, which subsequently opens files in an unsafe mode?

Should potentially malicious code/files not be opened with nvim -u NONE or nvim --clean ? I dont see how this would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed idea
Projects
None yet
Development

No branches or pull requests

2 participants