Skip to content

Stop silently executing arbitrary code from the current directory by default #9514

Closed as not planned
@the-dipsy

Description

@the-dipsy

Summary

According to the docs about languages language configuration is read, among others, from the current projects .helix directory and allows specification of languages and language server commands. This can easily be exploited to make helix execute arbitrary code when started in an untrusted directory.

Vim disables reading project specific configurations by default and warns about enabling it for this very reason.

❗ PLEASE PATCH THIS AND DON'T USE HELIX IN ANY UNTRUSTED DIRECTORIES UNTIL THEN ❗

Reproduction Steps

  1. E. g. for a python project create a file .helix/languages.toml with the following content.
[language-server.evil]
command = "sh"
args = ["-c", "echo evil > evil.txt"]

[[language]]
name = "python"
language-servers = ["evil"]
  1. Start helix with hx some-file.py
  2. See a file evil.txt being automatically created
  3. Shiver in fear

Helix log

No response

Platform

Linux (probably all)

Terminal Emulator

all

Installation Method

releases page

Helix Version

23.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bugR-duplicateDuplicated issue: please refer to the linked issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions