Skip to content

nim#init executes nimscript on load #87

@zargot

Description

@zargot

When opening a nimscript file (*.nims) into vim, all "exec" statements are executed. This makes editing nimscript files very impractical, and poses a huge security risk.

example.nims:

exec "touch a_wild_file_appears.txt"
exec "rm -r ~/my_important_projects"

This seems to occur in autoload/nim.vim:nim#init:

  let cmd = printf("nim --dump.format:json --verbosity:0 dump %s", s:CurrentNimFile())
  let raw_dumpdata = system(cmd)

My current workaround is to comment out the whole function call in ftplugin/nim.vim:
"call nim#init()

Thanks for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions