Error in Linux Filesystemen Endangers Postfix
Wietse Venema, the developer of Postfix, points in an advisory to a security problem in connection with the Linux and Solaris filesystems. As more recent versions of these operating systems no longer comply with the POSIX standard for links, local attackers may be able to attach files to other users' Postfix mailboxes.
The problem exists for all newer Linux and Solaris variants according to Venema, but not on BSD derivatives, AIX, Mac OS X, HP-UX, and other systems that either keep to the POSIX or X/Open standards.
Affected systems create hard links which in turn point to symlinks, not as hard links, but by creating a symbolic link without notifying the user of the fact. A local attacker can exploit this to attach data files for which the owner has not assigned write privileges, for example, the Postfix server mailbox.
Suse's Sebastian Krahmer discovered this behavior. It can be demonstrated on current Linux distributions (for example, Ubuntu 8.04 and Opensuse 11) with just a few steps:
$ PATH=/bin:/usr/bin:$PATH
$ mkdir test
$ cd test
$ touch src
$ ln -s src dst1
$ ln dst1 dst2
$ ls -l
Systems affected by the vulnerability create two symlinks in the directory despite entering Ln without the "-s" option:
$ ls -l
lrwxrwxrwx 2 user users 3 Mmm dd hh:mm dst1 -> src
lrwxrwxrwx 2 user users 3 Mmm dd hh:mm dst2 -> src
-rw-r--r-- 1 user users 0 Mmm dd hh:mm src
It would be correct, and POSIX-compliant to create a genuine hard link, says Venema:
$ ls -l
lrwxrwxrwx 2 user users 3 Mmm dd hh:mm dst1 -> src
-rw-r--r-- 2 user users 0 Mmm dd hh:mm dst2
-rw-r--r-- 1 user users 0 Mmm dd hh:mm src
In the case of the Postfix mail server, a local attacker could talk Postfix into attaching data to another user's file, including the mailbox, for example. If the server is running with root privileges, this might provide an attack vector for a local user independently of Postfix. If Postfix encounters a hard link on delivery, the mail server outputs an error message refuses to deliver; in contrast to this symlinks are permitted.
Users should thus apply the patch posted on the German Postfix page run by Patrick Koetter and Ralf Hildebrandt, and follow the instructions, especially if they use the Mailbox format with Local Delivery Agent, or Virtual Delivery Agent. Postfix mail servers running Maildir, or a local IMAP server like Cyrus or Dovecot, are not affected.
Venema uses a Perl script to ensure that the spooler directory is owned by root, and that each user already has a Mailbox file. As an alternative, mail server admins can patch the source code provided to their version of Postfix.
As a global countermeasure, which will work beyond the bounds of Postfix, Venema recommends preventing non-root users from creating hard links for other users' objects. This behavior is configurable on many systems.
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.