Skip to content

Pass the exported blacklist to mintupdate-automation on stdin - #1096

Open
lbellows wants to merge 1 commit into
linuxmint:masterfrom
lbellows:blacklist-export-via-stdin
Open

lbellows wants to merge 1 commit into
linuxmint:masterfrom
lbellows:blacklist-export-via-stdin

Conversation

@lbellows

Copy link
Copy Markdown

"Export blacklist" in Preferences writes the list to /tmp/mintUpdate/blacklist, then runs pkexec mintupdate-automation blacklist enable, which reads that path as root and appends it to /etc/mintupdate.blacklist.

/tmp/mintUpdate is shared (and created 0777 by the logger), so another local user can swap the file while the authentication dialog is open:

  • a symlink to /etc/shadow or /root/.ssh/id_rsa gets its contents copied into world-readable /etc/mintupdate.blacklist
  • extra lines such as * or linux* make mintupdate-cli skip those updates during automatic upgrades

(#155 was closed with "nothing is read from /tmp/mintUpdate". add_user_blacklist was added after that.)

This pipes the blacklist to the helper on stdin, so root never opens a file in /tmp. If stdin is a terminal (manual run) nothing is imported, the same as before when the tmp file was missing.

Tested: add_user_blacklist appends piped input, does nothing with empty stdin, and returns immediately on a tty. I have not run the full pkexec flow; pkexec passes stdin through (the same as echo … | pkexec tee).

Exporting the blacklist wrote it to /tmp/mintUpdate/blacklist, then
mintupdate-automation read that path as root after pkexec authentication.
Another local user can replace the file (or plant a symlink) while the
authentication dialog is open, so root appended arbitrary lines or the
contents of any file, e.g. /etc/shadow, to world-readable
/etc/mintupdate.blacklist.

Pipe the blacklist to the helper on stdin instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant