Skip to content

Insecure file permissions while saving #11362

@noktoborus

Description

@noktoborus

Summary

It looks like a vulnerability. Helix should not rely on a properly installed umask or its equivalent in the OS being used. A temporary file for writing should be created with the most secure access rights.

Reproduction Steps

  1. umask 0 (default umask usally is 022)
  2. chmod 0600 10gb_sensitive_content.txt
  3. hx 10gb_sensitive_content.txt
  4. type :w in helix
  5. while file saving ls -lha 10gb_sensitive_content.txt | cut -d' ' -f1

What I see: -rw-rw-rw-

Expected: -rw-------

After saving is completed permissions is as original file, e.g. -rw-------

Helix log

No response

Platform

Linux

Terminal Emulator

Alacritty

Installation Method

source

Helix Version

helix 24.7 (2a2bc79)

Metadata

Metadata

Assignees

Labels

A-helix-termArea: Helix term improvementsC-bugCategory: This is a bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions