macOSのシンボリックリンクとNFS共有の不具合を利用し、最新のmacOS 10.14.5 MojaveでもGatekeeperをバイパスできる脆弱性が発見される。

NFS共有とシンボリックリンクでバイパスできるGatekeepr セキュリティ
記事内に広告が含まれています。
スポンサーリンク
スポンサーリンク
スポンサーリンク

 NFS共有とシンボリックリンクの不具合を利用し、最新のmacOS 10.14.5 MojaveにもGatekeeprをバイパスできる脆弱性が発見されたそうです。詳細は以下から。

AppleのGatekeeperアイコン

 イタリアのCeo and Senior Security ResearcherでTorブラウザなどの脆弱性を研究しているセキュリティ研究者のFilippo Cavallarinさんは現地時間2019年05月24日、Appleが05月13日にリリースした最新のmacOS Mojave 10.14.5 (18F132)を含む全てのmacOS 10.14.xでGatekeeperをバイパスし、任意のコード(アプリ)を実行できる脆弱性が発見したとしてそのPoCなどを公開しています。

NFS共有とシンボリックリンクでバイパスできるGatekeepr

DETAILS
As per-design, Gatekeeper considers both external drives and network shares as safe locations and it allows any application they contain to run.

MacOS X GateKeeper Bypass – FCVL

NFS共有とシンボリックリンク

 この脆弱性が興味深いのが、AppleのGatekeeperが外部ドライブとネットワーク共有(NFS)ボリュームを安全な場所(Safe locations)と位置づけて、この場所にあるアプリ(Unsigned)の実行を許可しているというもので、Filippoさんはこの仕様とオートマウント(autofs)、そしてsymlinksが含まれたzipファイルを解凍するmacOSがsymlinks作成前にチェックを行わないということに目をつけ、

The first legit feature is automount (aka autofs) that allows a user to automatically mount a network share just by accessing a “special” path, in this case, any path beginning with “/net/”.[…]
The second legit feature is that zip archives can contain symbolic links pointing to an arbitrary location (including automount enpoints) and that the software on MacOS that is responsable to decompress zip files do not perform any check on the symlinks before creatig them.

MacOS X GateKeeper Bypass – FCVL

これらを組み合わせて、ダウンロードしたzipファイル(シンボリックリンクを含む)をユーザーに解凍させNFS共有に誘導し、偽装されたアプリを実行させてやることができれば、Gatekeeperをバイパスし悪意のある攻撃者がshellを取得することも可能だとして、その手順を公開しています。

Gatekeeperの脆弱性

 Gatekeeperをバイパスさせる方法は古くから研究されており、最近ではGatekeeperがWindowsの実行ファイル(.exe)をチェックしないことを利用して、Mono(.NET)フレームワークを利用したExeファイルを介してGatekeeperをバイパスする方法が実際の攻撃にも使われていましたが、

Windows App Runs on Mac, Downloads Info Stealer and Adware

Filippoさんは2019年02月22日にこの問題をAppleに報告し、Appleは05月15日にこの問題を修正する予定でしたが、AppleがFilippoさんのメールに返事をしなくなったため90日を迎える05月24日に公開したそうで、この脆弱性を一時的に修正したい場合はrootユーザーで”/etc/auto_master”ファイルの”/net”をコメントアウトし、オートマウントを止めればよいという対処法も公開しているので、興味のある方はチェックしてみてください。

対処法

  1. Edit /etc/auto_master as root
  2. Comment the line beginning with ‘/net’
  3. Reboot

コメント

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