Mac OS X Security Issue – TruBlueEnvironment Privilege Escalation Attack
Computers running Mac OS X prior to 10.2.4 and unpatched contain a vulnerability that can be exploited to create files that can be run at elevated privileges because of the TruBlueEnvironment. Included is the security advisory covering the issue discovered by @Stake’s Dave.
For those unable to update they can change the permissions of the vulnerable files to the admin group.
sudo chown .admin /System/Library/CoreServices/Classic\ Startup.app/Contents/Resources/TruBlueEnvironment
sudo chmod 4750 /System/Library/CoreServices/Classic\ Startup.app/Contents/Resources/TruBlueEnvironment
Advisory Name: TruBlueEnvironment Privilege Escalation Attack
Release Date: 02/14/2003
Platform: MacOS X (10.2.3 and below)
Severity: Local users can gain root privileges
Author: Dave G.
Vendor Status: updated version of OS available
CVE Candidate: CAN-2003-XXXX
TruBlueEnvironment is part of the MacOS Classic Emulator. It
is setuid root and installed by default. By setting certain environment
variables, it is possible to overwrite any file on the system, or create
arbitrary files owned as root with the attacker’s umask. This
vulnerability can be leveraged to create files that will get executed by
root through the cron facility.
TruBluEnvironment uses an environment variable to determine where to
out debugging information. Local users can set this to environment
variable to point at any file on the filesystem. If the file exists, it
will be reset to zero bytes. If the file does not exist, it will be
created with the umask inherited from the calling process. While
cannot create files with execute permissions set, they can create files
that are world writable.
Under MacOS X, this vulnerability can be used to create files that will
be run automatically via cron. By default, cron will launch maintenance
scripts using the periodic command. This command will take several
and either ‘source’ them or run them through a shell interpreter.
these scripts are running as root, it is possible to obtain
privileges on any MacOS X system running cron and TruBlueEnvironment.
Classic: The Mac OS X 10.2.4 release fixes CAN-2003-0088, where an
may change an environment variable to create arbitrary files or
existing files, which could lead to obtaining elevated privileges.
Credit to Dave G. from @stake, Inc. for discovering this issue.
If possible upgrade to Mac OS X 10.2.4. Another solution is to restrict
access to the TruBlueEnvironment(*) executable, or remove it entirely if
it is not being used. One approach to restricting access would be to
remove global execute permissions from the TruBlueEnvironment
executable, and only allow a specific group to execute the application. The
following commands will restrict access to the ‘admin’ group:
sudo chown .admin /System/Library/CoreServices/Classic\
sudo chmod 4750 /System/Library/CoreServices/Classic\
(*) Located in /System/Library/CoreServices/Classic
Common Vulnerabilities and Exposures (CVE) Information:
The Common Vulnerabilities and Exposures (CVE) project has assigned
the following names to these issues. These are candidates for
inclusion in the CVE list (http://cve.mitre.org), which standardizes
names for security problems.
@stake Vulnerability Reporting Policy:
@stake Advisory Archive:
Copyright 2003 @stake, Inc. All rights reserved.