Skip to content

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

Merged
mtwebster merged 2 commits into
linuxmint:masterfrom
lbellows:blacklist-export-via-stdin
Nov 3, 2026
Merged

mtwebster merged 2 commits into
linuxmint:masterfrom
lbellows:blacklist-export-via-stdin

Conversation

@lbellows

Copy link
Copy Markdown
Contributor

"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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of this generated file please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in c8bb032, thanks.

@mtwebster
mtwebster merged commit 19bca4c into linuxmint:master Nov 3, 2026
4 checks passed
@lbellows
lbellows deleted the blacklist-export-via-stdin branch November 3, 2026 19:16
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.

2 participants