OS X YosemiteのDYLD_PRINT_TO_FILEに権限昇格の脆弱性が発見され、OS X 10.10.4でも実行可能なExploit Codeも公開される。

OS X 10.10 Yosemiteのロゴ Yosemite
記事内に広告が含まれています。
スポンサーリンク
スポンサーリンク
スポンサーリンク

 OS X 10.10~10.10.4 YosemiteのDYLD_PRINT_TO_FILEに権限昇格の脆弱性が発見されたそうです。詳細は以下から。

OS X 10.10 Yosemiteのロゴ

 ドイツのセキュリティ企業”SektionEins”がOS X Yosemiteのdynamic linker dyldに非rootユーザーがroot権限を使用できる権限昇格の脆弱性が存在すると発表しています。

 AppleはOS X 10.10 Yosemiteで新たにいくつかのdyldを導入したそうですが、その中の1つに”DYLD_PRINT_TO_FILE”という環境変数が存在し、これは書き込み可能なログファイルを作成しますが、今回発見された脆弱性はこの”DYLD_PRINT_TO_FILE”が実行終了時にファイルをクローズしない不具合を使用したもので、最終的に非rootユーザーがroot権限でのファイルの作成を可能にします。

DYLD_PRINT_TO_FILE
This is a path to a (writable) file. Normally, the dynamic linker writes all logging output (triggered by DYLD_PRINT_* settings) to file descriptor 2 (which is usually stderr). But this setting causes the dynamic linker to write logging output to the specified file.
[dyld section 1 - man page]

When this variable was added the usual safeguards that are required when adding support for new environment variables to the dynamic linker have not been used. Therefore it is possible to use this new feature even with SUID root binaries. This is dangerous, because it allows to open or create arbitrary files owned by the root user anywhere in the file system. Furthermore the opened log file is never closed and therefore its file descriptor is leaked into processes spawned by SUID binaries. This means child processes of SUID root processes can write to arbitrary files owned by the root user anywhere in the filesystem. This allows for easy privilege escalation in OS X 10.10.x.
[OS X 10.10 DYLD_PRINT_TO_FILE Local Privilege Escalation Vulnerability – SektionEins GmbH]

チェック方法

 SektionEinsはこの脆弱性のチェック法も公開しており、以下の様にEDITORの環境変数に”DYLD_PRINT_TO_FILE”を使用してルートディレクトリなどの書き込み権限の無い場所に任意のファイルを指定して編集してやると所有者がrootのファイルが出力されます。

DYLD_PRINT_TO_FILE-issune-on-yosemite3

esting if your system is vulnerable to this attack or not is quite easy and can be done directly from the commandline. Just enter the following into a shell:

$ EDITOR=/usr/bin/true DYLD_PRINT_TO_FILE=/this_system_is_vulnerable crontab -e

Afterward the root directory of your filesystem should show the created file with root permissions.

 AppleはOS X 10.10.4 Yosemiteで同様の権限昇格型脆弱性”Rootpipe”を全て修正した様ですが、SektionEinsよるとこの脆弱性はOS X 10.10.4や現在Beta版のOS X 10.10.5でも修正されていないものの、

関連記事

 OS X 10.11 El Capitanの1st Betaではすでに修正されているため、Appleがこの事を認識しているかは不明だとしています。この脆弱性は既に多くのユーザーが確認しており、SektionEinsはExploit Codeも公開しているので興味がある方は関連リンクからどうぞ。

At the moment it is unclear if Apple knows about this security problem or not, because while it is already fixed in the first betas of OS X 10.11, it is left unpatched in the current release of OS X 10.10.4 or in the current beta of OS X 10.10.5.

[OS X 10.10 DYLD_PRINT_TO_FILE Local Privilege Escalation Vulnerability – SektionEins GmbH]

追記

 DYLD_PRINT_TO_FILE を使用し一般ユーザーを完全にrootへ昇格できる1 Line Commandも公開されてきているのでシステム管理者は注意して下さい。

関連リンク:

コメント

タイトルとURLをコピーしました