SIPとcronの不具合を利用しmacOS 10.13.1 High Sierraで非rootユーザーがroot権限を得られる脆弱性が発見された様です。詳細は以下から。
イギリスPosixOne Ltdのエンジニアでセキュリティ研究者のMark Wadhamさんはあるソフトウェアのセキュリティ調査を行っていた際、macOS 10.13.1でセキュリティ整合性保護機能(SIP:通称rootless)で保護されていないファイルに非rootユーザーで書き込めてしまう不具合を発見したそうで、書き込みを行ったファイルは所有者がrootから変更されてしまうようですが、
Recently I was working on a security issue in some other software that has yet to be disclosed which created a rather interesting condition. As a non-root user I was able to write to any file on the system that was not SIP-protected but the resulting file would not be root-owned, even if it previously was.
macOS High Sierra 10.13.1 insecure cron system – Mark Wadham
Wadhamさんは友人の助言によりmacOSのcronシステムはcrontabの所有者をチェックしない事に気づき、cronの整合性チェック問題とSIPの不具合を利用すれば以下の方法でroot権限を得ることが可能だったとコメントしています。
I then discovered (after a tip from a friend – thanks pndc!) that the cron system in macOS does not care who the crontab files are owned by. Getting root was a simple case of creating a crontab file at:
/var/at/tabs/root
with a 60-second cron line, eg:
* * * * * chown root:wheel /tmp/payload && chmod 4755 /tmp/payload
macOS High Sierra 10.13.1 insecure cron system – Mark Wadham
この脆弱性は既にAppleに報告済との事ですが、macOS 10.13.2でも修正されていないようで、Wadhamさんもこれ以上の情報を公開していないので、今後のセキュリティ・アップデートで修正された後にdiscloseされると思われます。
- macOS High Sierra 10.13.1 insecure cron system – Mark Wadham
- Full Disclosure: macOS High Sierra 10.13.1 insecure cron system – SecLists.Org
- Apple macOS 10.13.1 (High Sierra) – Insecure Cron System Local Privilege Escalation – Exploit Database