CVE-2024-35235
Cupsd Listen arbitrary chmod 0140777
In short
When CUPS starts with a Listen configuration pointing to a symbolic link, it can accidentally change file permissions to world-writable, potentially exposing sensitive system files. This is especially dangerous because CUPS often runs as root, so attackers could gain unauthorized access to important configuration files.
Technical detail
A symlink-based arbitrary chmod vulnerability in CUPS (CVE-2024-35235) allows an attacker to modify file permissions via a malicious Listen configuration entry. The attack vector requires the ability to create or control symlinks on the system; when cupsd starts, it applies chmod 0140777 to the symlink target, potentially leading to world-writable access to critical files including cupsd.conf. On systems with restrictive AppArmor policies, this can be chained with PPD-based command injection (FoomaticRIPCommandLine) to achieve arbitrary command execution.
Summary generated and translated by AI from the official description.
OpenPrinting CUPS is an open source printing system for Linux and other Unix-like operating systems. In versions 2.4.8 and earlier, when starting the cupsd server with a Listen configuration item pointing to a symbolic link, the cupsd process can be caused to perform an arbitrary chmod of the provided argument, providing world-writable access to the target. Given that cupsd is often running as root, this can result in the change of permission of any user or system files to be world writable. Given the aforementioned Ubuntu AppArmor context, on such systems this vulnerability is limited to those files modifiable by the cupsd process. In that specific case it was found to be possible to turn the configuration of the Listen argument into full control over the cupsd.conf and cups-files.conf configuration files. By later setting the User and Group arguments in cups-files.conf, and printing with a printer configured by PPD with a `FoomaticRIPCommandLine` argument, arbitrary user and group (not root) command execution could be achieved, which can further be used on Ubuntu systems to achieve full root command execution. Commit ff1f8a623e090dee8a8aadf12a6a4b25efac143d contains a patch for the issue.
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N