iDefense Security Advisory 03.02.06 - Local exploitation of a design error in version 10.3.9 of Apple Computer Inc.'s Mac OS X could allow arbitrary files to be overwritten with user supplied contents. iDefense has confirmed the existence of this vulnerability in Mac OS X Version 10.3.9. In addition, the following versions been confirmed by the vendor to be vulnerable: Mac OS X Server Version 10.3.9, Mac OS X Version 10.4.5, Mac OS X Server Version 10.4.5.

Apple Mac OS X passwd Arbitrary Binary File Creation/Modification
iDefense Security Advisory 03.02.06
http://www.idefense.com/application/poi/display?type=vulnerabilities
March 02, 2006
I. BACKGROUND
Mac OS X is an operating system for the Apple family of microcomputers.
More information is available at the following link:
http://www.apple.com/macosx/
II. DESCRIPTION
Local exploitation of a design error in version 10.3.9 of Apple Computer
Inc.'s Mac OS X could allow arbitrary files to be overwritten with user
supplied contents.
The /usr/bin/passwd binary is a setuid application which allows users to
change their password. There are two related vulnerabilities.
The first vulnerability occurs because the Mac OS X version of the
passwd utility accepts options specifying which password database to
operate on. The passwd binary does not check that the user has
permissions to create a file in the location specified and does not set
the created file permissions. By setting the file creation mask to 0 a
user can create arbitrary files owned by root, with permissions which
allow any user to change the contents.
The second vulnerability exists in the insecure creation of temporary
files with predictable names. The temporary filename created by the
process is in the form /tmp/.pwtmp.<pid> where <pid> is the process id
of the passwd process. By creating a symbolic link to the target file,
and then changing the password, it is possible to put controllable
contents into the target file.
III. ANALYSIS
Successful exploitation of either of these vulnerabilities would allow a
local attacker to gain elevated privileges in a number of ways.
In the case of the first vulnerability, a new file could be created in
the /etc directory, such as etc/rc.local_tuning, which is sourced if it
exists during the system start up process as the root user.
The second vulnerability would allow an attacker overwrite a file with
user controlled contents. This can be leveraged to provide privilege
escalation by, for example, creating a new /etc/sudoers file.
IV. DETECTION
iDefense has confirmed the existence of this vulnerability in Mac OS X
Version 10.3.9. In addition, the following versions been confirmed by
the vendor to be vulnerable:
* Mac OS X Server Version 10.3.9
* Mac OS X Version 10.4.5
* Mac OS X Server Version 10.4.5
It is suspected that all prior releases are vulnerable.
V. WORKAROUND
Remove the setuid bit from the /usr/bin/passwd binary by executing the
following command as root:
chmod -s /usr/bin/passwd
This workaround will prevent non-root users from being able to change
their password.
VI. VENDOR RESPONSE
Apple have released an update for this vulnerability, details of which
are available at the following location:
http://docs.info.apple.com/article.html?artnum=61798
Apple security updates are available via the Software Update mechanism:
http://docs.info.apple.com/article.html?artnum=106704
Apple security updates are also available for manual download:
http://www.apple.com/support/downloads
VII. CVE INFORMATION
The Common Vulnerabilities and Exposures (CVE) project has assigned the
following names to these issues:
CVE-2005-2713 - passwd file creation and permissions
CVE-2005-2714 - temporary file symlink problem
VIII. DISCLOSURE TIMELINE
08/23/2005 Initial vendor notification
08/27/2005 Initial vendor response
03/02/2006 Coordinated public disclosure
IX. CREDIT
Discovery of these vulnerabilities are credited to vade79.
Get paid for vulnerability research
http://www.idefense.com/poi/teams/vcp.jsp
Free tools, research and upcoming events
http://labs.idefense.com
X. LEGAL NOTICES
Copyright (c) 2006 iDefense, Inc.
Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDefense. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@idefense.com for permission.
Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
APPLE-SA-2006-03-01 Security Update 2006-001
Security Update 2006-001 is now available and addresses the following
issues:
apache_mod_php
CVE-ID: CVE-2005-3319, CVE-2005-3353, CVE-2005-3391, CVE-2005-3392
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Multiple security issues in PHP 4.4
Description: PHP 4.4.1 fixes several security issues in the Apache
module and scripting environment. Details of the fixes are
available via the PHP web site (www.php.net). PHP ships with Mac OS
X but is disabled by default.
automount
CVE-ID: CVE-2006-0384
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Malicious network servers may cause a denial of service or
arbitrary code execution
Description: File servers on the local network may be able to cause
Mac OS X systems to mount file systems with reserved names. This
could cause the systems to become unresponsive, or possibly allow
arbitrary code delivered from the file servers to run on the target
system.
BOM
CVE-ID: CVE-2006-0391
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Directory traversal may occur while unpacking archives with
BOM
Description: The BOM framework handles the unpacking of certain
types of archives. This framework is vulnerable to a directory
traversal attack that can allow archived files to be unpacked into
arbitrary locations that are writable by the current user. This
update addresses the issue by properly sanitizing those paths.
Credit to Stephane Kardas of CERTA for reporting this issue.
Directory Services
CVE-ID: CVE-2005-2713, CVE-2005-2714
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Malicious local users may create and manipulate files as
root
Description: The passwd program is vulnerable to temporary file
attacks. This could lead to privilege elevation. This update
addresses the issue by anticipating a hostile environment and by
creating temporary files securely. Credit to Ilja van Sprundel of
Suresec LTD, vade79, and iDefense (idefense.com) for reporting this
issue.
FileVault
CVE-ID: CVE-2006-0386
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: FileVault may permit access to files during when it is
first enabled
Description: User directories are mounted in an unsafe fashion when
a FileVault image is created. This update secures the method in
which a FileVault image is created.
IPSec
CVE-ID: CVE-2006-0383
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Remote denial of service against VPN connections
Description: Incorrect handling of error conditions for virtual
private networks based on IPSec may allow a remote attacker to
cause a service interruption. This update addresses the issues by
correctly handling the conditions that may cause crashes. Credit to
OUSPG from the University of Oulu, NISCC, and CERT-FI for
coordinating and reporting this issue.
LibSystem
CVE-ID: CVE-2005-3706
Available for: Mac OS X v10.4.5, Mac OS X Server v10.4.5
Impact: Attackers may cause crashes or arbitrary code execution
depending upon the application
Description: An attacker able to cause an application to make
requests for large amounts of memory may also be able to trigger a
heap buffer overflow. This could cause the targeted application to
crash or execute arbitrary code. This update addresses the issue by
correctly handling these memory requests. This issue does not
affect systems prior to Mac OS X v10.4. Credit to Neil Archibald of
Suresec LTD for reporting this issue.
Mail
CVE-ID: CVE-2006-0395
Available for: Mac OS X v10.4.5, Mac OS X Server v10.4.5
Impact: Download Validation fails to warn about unsafe file types
Description: In Mac OS X v10.4 Tiger, when an email attachment is
double-clicked in Mail, Download Validation is used to warn the
user if the file type is not "safe". Certain techniques can be used
to disguise the file's type so that Download Validation is
bypassed. This update addresses the issue by presenting Download
Validation with the entire file, providing more information for
Download Validation to detect unknown or unsafe file types in
attachments.
perl
CVE-ID: CVE-2005-4217
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9
Impact: Perl programs may fail to drop privileges
Description: When a perl program running as root attempts to switch
to another user ID, the operation may fail without notification to
the program. This may cause a program to continue to run with root
privileges, assuming they have been dropped. This can cause
security issues in third-party tools. This update addresses the
issue by preventing such applications from continuing if the
operation fails. This issue does not affect Mac OS X v10.4 or later
systems. Credit to Jason Self for reporting this issue.
rsync
CVE-ID: CVE-2005-3712
Available for: Mac OS X v10.4.5, Mac OS X Server v10.4.5
Impact: Authenticated users may cause an rsync server to crash or
execute arbitrary code
Description: A heap-based buffer overflow may be triggered when the
rsync server is used with the flag that allows extended attributes
to be transferred. It may be possible for a malicious user with
access to an rsync server to cause denial of service or code
execution. This update addresses the problem by ensuring that the
destination buffer is large enough to hold the extended attributes.
This issue does not affect systems prior to Mac OS X v10.4. Credit
to Jan-Derk Bakker for reporting this issue.
Safari
CVE-ID: CVE-2005-4504
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Viewing a maliciously-crafted web page may result in
arbitrary code execution
Description: A heap-based buffer overflow in WebKit's handling of
certain HTML could allow a malicious web site to cause a crash or
execute arbitrary code as the user viewing the site. This update
addresses the issue by preventing the condition causing the
overflow. Credit to Suresec LTD for reporting this issue.
Safari
CVE-ID: CVE-2006-0387
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Viewing a malicious web page may cause arbitrary code
execution
Description: By preparing a web page including specially-crafted
JavaScript, an attacker may trigger a stack buffer overflow that
could lead to arbitrary code execution with the privileges of the
user. This update addresses the issue by performing additional
bounds checking.
Safari
CVE-ID: CVE-2006-0388
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Remote web sites can redirect to local resources, allowing
JavaScript to execute in the local domain
Description: Safari's security model prevents remote resources from
causing redirection to local resources. An issue involving HTTP
redirection can cause the browser to access a local file, bypassing
certain restrictions. This update addresses the issue by preventing
cross-domain HTTP redirects.
Safari, LaunchServices
CVE-ID: CVE-2006-0394
Available for: Mac OS X v10.3.9, Mac OS X Server v10.3.9, Mac OS X
v10.4.5, Mac OS X Server v10.4.5
Impact: Viewing a malicious web site may result in arbitrary code
execution
Description: It is possible to construct a file which appears to be
a safe file type, such as an image or movie, but is actually an
application. When the "Open `safe' files after downloading" option
is enabled in Safari's General preferences, visiting a malicious
web site may result in the automatic download and execution of such
a file. A proof-of-concept has been detected on public web sites
that demonstrates the automatic execution of shell scripts. This
update addresses the issue by performing additional download
validation so that the user is warned (in Mac OS X v10.4.5) or the
download is not automatically opened (in Mac OS X v10.3.9).
Syndication
CVE-ID: CVE-2006-0389
Available for: Mac OS X v10.4.5, Mac OS X Server v10.4.5
Impact: Subscriptions to malicious RSS content can lead to
cross-site scripting
Description: Syndication (Safari RSS) may allow JavaScript code
embedded in feeds to run within the context of the RSS reader
document, allowing malicious feeds to circumvent Safari's security
model. This update addresses the issue by properly removing
JavaScript code from feeds. Syndication is only available in Mac OS
X v10.4 and later.
The following security enhancements are also included in this update:
FileVault: AES-128 encrypted FileVault disk images are now created
with more restrictive operating system permissions. Credit to Eric
Hall of DarkArt Consulting Services for reporting this issue.
iChat: A malicious application named Leap.A that attempts to
propagate using iChat has been detected. With this update for Mac
OS X v10.4.5 and Mac OS X Server v10.4.5, iChat now uses Download
Validation to warn of unknown or unsafe file types during file
transfers.
Users should use caution when opening files that are obtained from
the network. Further information is available via:
http://docs.info.apple.com/article.html?artnum=108009
Security Update 2006-001 may be obtained from the Software Update
pane in System Preferences, or Apple's Software Downloads web site:
http://www.apple.com/support/downloads/
For Mac OS X v10.4.5 (PowerPC) and Mac OS X Server v10.4.5
The download file is named: "SecUpd2006-001Ti.dmg"
Its SHA-1 digest is: 999b73a54951b4e0a7f873fecf75f92840e8b439
For Mac OS X v10.4.5 (Intel)
The download file is named: "SecUpd2006-001Intel.dmg"
Its SHA-1 digest is: 473f94264876fa49fa15a8b6bb4bc30956502ad5
For Mac OS X v10.3.9
The download file is named: "SecUpd2006-001Pan.dmg"
Its SHA-1 digest is: b6a000d451a1b1696726ff60142fc3da08042433
For Mac OS X Server v10.3.9
The download file is named: "SecUpdSrvr2006-001Pan.dmg"
Its SHA-1 digest is: 2299380d72a61eadcbd0a5c6f46c924600ff5a9c
Information will also be posted to the Apple Product Security
web site:
http://docs.info.apple.com/article.html?artnum=61798
This message is signed with Apple's Product Security PGP key,
and details are available at:
http://www.apple.com/support/security/pgp/
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.5 (Build 5050)
iQEVAwUBRAYYVoHaV5ucd/HdAQJQWggApQmizj2t3+/87Fqun66/HCEkFt2YhUoe
cmel0/KwJhWrk+LV+CYvixbDvKuGIjP8CWB9/s78YN93pOI5WcfyTKd07rEQYkT4
i8KPrM9QjdvgIjKd6O/VAOkzBc3DqV7KNVR2Hewa3jOigTm7Yxil9o/nZt1TLxAI
9TN0uduc13WHC8WE2N41I8MQ+VdGTX3ANZkfgR90lua4A2E1ab9kCN2qbg+E7Cus
SkwsKp0qSH7bl8v0/R6c1hsYG0T1RwSWU6arAEliqzrrIbCm0Yxtgwp/CYFWC46j
TQNCcppNgcr/pVPojACy8WFtQ3wEb6rJ4ZjH1C5nOem2EoCBh10WFw==
=1Ww0
-----END PGP SIGNATURE-----

-
漏洞信息

-
漏洞描述

Mac OS X contains a flaw that may allow a malicious local user to create arbitrary files on the system. The issue is due to the passwd program creating temporary files insecurely, using the form /tmp/.pwtmp.<pid> where <pid> is the process id of the passwd process. It is possible for a user to use a symlink style attack to manipulate arbitrary files, resulting in a loss of integrity.

-
时间线

公开日期:
2006-02-28

发现日期:
2005-08-23

利用日期:Unknow

解决日期:Unknow

-
解决方案

Currently, there are no known workarounds or upgrades to correct this issue. However, Apple has released a patch (2006-001) to address this vulnerability.