"OpenID: Single Sign-On for the Internet" を読んだ (2)
Negotiating crypto keys
associate の時に DH 鍵交換を行う際に潜む問題点です。
何が問題なのか
In the original description, the Diffie-Hellman exchange by itself does not provide authentication of the communicating parties and is thus vulnerable to a man-in-the-middle attack. A person in the middle may establish two distinct Diffie-Hellman key exchanges, one with Alice and the other with Bob, effectively masquerading as Alice to Bob, and vice versa, allowing the attacker to decrypt (and read or store) then re-encrypt the messages passed between them. A method to authenticate the communicating parties to each other is generally needed to prevent this type of attack.に書いてあるんですけど man-in-the-middle attack (中間者攻撃) に弱いって事が DH 鍵交換の欠点みたいです。どういう事かと言うと、二者間で互いに相手が本当に期待する相手であるならば問題は無いんですが、それが保証されていない場合に問題になってしまいます。 最近話題になってた ARP Spoofing だとか、DNS Spoofing と言った手法で、中間者が存在する場合、中間者が二者それぞれと DH して橋渡ししてあげれば、見た目上は期待通りの挙動をしつつ、中身はすっぱ抜かれるよねって事ですね。
まとめ
SSL/TLS などの https を使えと。 その場合はメッセージ自体が安全になるから DH 鍵交換は使わないでも良い。 spec には、DH 鍵交換 + http を止めて https のが RECOMMENDED だよとは書いてない気がする。追記 (2008-06-13T18:22:03+09:00)
https を使う場合の association の補足
id:machu さんにブクマコメントで突っ込まれてた件ですが、「SSL/TLS などの https を使えと。 その場合はメッセージ自体が安全になるから DH 鍵交換は使わないでも良い。」←鍵交換しないとレスポンスのメッセージ検証ができないよね / 「DH」じゃなくて鍵をplainに送るという話かな?鍵交換しないとメッセージの署名出来ないから当然するんだけど、知らない人の為に一応解説すると、association は、
- association を行う
- association を行わない
- Stateless モードになって、後でcheck_authenticationを実行しなければならない