Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

modeline by nvim 0.5 is as secure #139

Merged
merged 1 commit into from
Sep 27, 2021
Merged

modeline by nvim 0.5 is as secure #139

merged 1 commit into from
Sep 27, 2021

Conversation

osamuaoki
Copy link
Contributor

Here is a patch for #134

Mode line is lines such as
# vim:set ai si ts=2 sts=2 sw=2 et:

This can set vim some limitted options.


Vim's modeline was known to be security risk.

Arbitrary code execution issue was initially addressed by Vim upstream
using sandbox approach. Nvim developer found security bug in this
sandboxing code. This history made Nvim to disable this feature. Vim
distributors such as Debian also disable this feature in its default
install, too.

Considering the recent change[*] to use more restrictive whitelist
approach, use of modeline became as secure as external packages
such as securemodelines written in vimL.

[*] neovim/neovim#2865

Signed-off-by: Osamu Aoki [email protected]

Vim's modeline was known to be security risk.

Arbitrary code execution issue was initially addressed by Vim upstream
using sandbox approach.  Nvim developer found security bug in this
sandboxing code.  This history made Nvim to disable this feature.  Vim
distributors such as Debian also disable this feature in its default
install, too.

Considering the recent change[*] to use more restrictive whitelist
approach, use of modeline became as secure as external packages
such as securemodelines written in vimL.

  [*] neovim/neovim#2865

Signed-off-by: Osamu Aoki <[email protected]>
@NTBBloodbath NTBBloodbath added branch: develop For stuff regarding to development branch scope: enhancement New feature or request labels Sep 27, 2021
Copy link
Collaborator

@NTBBloodbath NTBBloodbath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for such detailed explanation about the safety of this option :)

@NTBBloodbath NTBBloodbath linked an issue Sep 27, 2021 that may be closed by this pull request
@NTBBloodbath NTBBloodbath merged commit 4fb26e9 into doom-neovim:develop Sep 27, 2021
@osamuaoki osamuaoki deleted the securemodeline branch September 28, 2021 00:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
branch: develop For stuff regarding to development branch scope: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for modeline
2 participants