tmux-plugins/tmux-copycat

Possible leakage of personal information

raymond-w-ko opened this issue · 4 comments

Hello, love your plugin so far.

I was looking in /tmp/ for whatever reason and noticed that the temporary directory created by tmux-copycat was group and world readable. I would consider this not desirable for many reason, especially on server with lots of users, since you could be handling sensitive information or passwords, and copycat_generate_results.sh would basically expose your terminal for the world or evil scripts to read and collect info. This technically could be avoided by the user set a better umask but I don't think a lot of people do that by default.

I would recommend setting umask 0077 so that group and world gets no permissions, and also force chmod 700 after mkdir -p "$(_get_tmp_dir)" to fix old installations. delete_old_files should take care of old copies and the new umask will generate correct tmp files from then on.

Hey,
sorry for the late response. I agree with this thinking, we should probably fix this. PR is welcome!

#97 fixes this.

After looking into this a bit more, just setting the permissions of the working directory in /tmp is enough to block all access to it. This also works with new and old temporary directories.

While using umask is better for security, it probably is overkill, and could cause unintentional permission changes that is very hard to track down.

Yearly bump.

My pull request is very low risk, just one chmod so I hope it is included soon.

Merged, thanks