macOS High Sierraで設定したパスワードがパスワードのヒントに平文のまま表示されてしまう不具合の原因をリバースエンジニアリングにより解説した記事が話題。

macOSのKeychainのアイコン。 macOS High Sierra
記事内に広告が含まれています。
スポンサーリンク
スポンサーリンク
スポンサーリンク

 macOS High Sierraで設定したパスワードがパスワードのヒントに平文のまま表示されてしまう不具合の原因をリバースエンジニアリングにより解説した記事が話題となっています。詳細は以下から。

macOSのKeychainのアイコン。

 昨日、元Microsoftのエンジニアで現在はPSPDFKitを開発しているDaniel Martínさん「macOS 10.13 High Sierraのディスクユーティリティでパスワードのヒントにパスワードが平文のまま保存され表示されてしまう不具合の原因は、コードのコピー&ペーストが原因ではないか?」というツイートをしていましたが、Martínさんがこの根拠をリバースエンジニアリングを用いて解説しています。

Reported by Matheus Mariano, a Brazilian software developer, a programming error was discovered in Apple’s most recent operating system, High Sierra, that exposed passwords of encrypted volumes as password hints. A serious bug that quickly made the headlines in technology websites everywhere.

Reverse Engineering macOS High Sierra Supplemental Update – Cocoa Engineering

StorageKit

 MartínさんがAppleが公開した「macOS 10.13 High Sierra」と「追加アップデート」のディスクユーティリティの比較をEmacs(IDA)やDiaphoraを利用して行ったところ、新旧のディスクユーティリティのバイナリに違いはなく、ディスクユーティリティに利用されていたAppleのプライベートフレームワーク「StorageKit」にAPFSに対応するため加えられたコードがこの不具合を引き起こしたようで、

Reference to a StorageKit structure from controller code in Disk Utility.

This is part of the code that runs when you add a new APFS volume from the Disk Utility interface (concretely, the controller responsible for managing the new volume sheet).

Reverse Engineering macOS High Sierra Supplemental Update – Cocoa Engineering

昨日Twitter上にも投稿していたように、そのコードは”kSKAPFSDiskPasswordOption”と”kSKAPFSDiskPasswordHintOption”という「パスワード」と「パスワードのヒント」の変数が違うものの同じ構造のためコピー&ペーストされた可能性が高く、これによりレジスタv50 (入力されたパスワード)を「パスワード」と「パスワードのヒント」に設定するという大きな間違いを導いてしまったようで、

NSMutableDictionary *optionsDictionary = [NSMutableDictionary alloc] init];
[...]
optionsDictionary[kSKAPFSDiskPasswordOption] = password;
 
optionsDictionary[kSKAPFSDiskPasswordHintOption] = password;

This is an example of a common category of bugs where code with a common structure is copied and pasted but the developer forgets to make every required modification and consequently there’s a fatal change in behavior.

Reverse Engineering macOS High Sierra Supplemental Update – Cocoa Engineering

Martínさんはこの様なバグは常に存在し、完全に潰すことは出来なくてもユニットテストやコードレビューによりバグを発見することが出来るとまとめているので、興味のある方はチェックしてみて下さい。

コメント

  1. 匿名 より:

    macOSは最低でも2年おきのリリースにしてほしいわ

  2. 匿名 より:

    自分の不具合は棚に上げてAppleの粗探しか
    MSは本当に根性が腐ってるな

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