ActiveX コントロールの安全性チェックの仕方

(日本語訳も機械翻訳でないものが公開されているけれど、自分でもした。)

コントロールのセキュリティはとても主観的な判断になります。以下の質問は、コントロールのセキュリティを考えるときに役立つでしょう。また大規模なセキュリティレビューの一部分として活用することもできるでしょう。

  • ドメイン、ゾーンの利用を制限していますか?より詳しくは site-locking your control を参照してください。
  • ユーザーの個人情報をネットワークへ流したり、もしくは他のユーザーに見せたりしますか?
  • 任意の記録データの読み取り、書き込み、作成、検出、削除をしますか?この記録データはファイルシステムレジストリー、フレンドリスト、カメラ、 USB デバイスなどにあると考えてください。
  • コントロールは、あるインターネットサイトから別のサイトへデータを渡すでしょうか?イントラネットからインターネットへ、ローカルコンピューターからインターネットへデータを送信しますか?
  • コントロールはコードやスクリプトを実行しますか?もし実行するなら、さて、そのコードやスクリプトはどこから受け取りますか?
  • コントロールはユーザーの操作の結果、ユーザーに気づかせることなく任意の操作やプログラムを実行するでしょうか?
  • コントロールブラウザーや OS、その他アプリケーションの持つセキュリティ機能を一部でも壊したりしないでしょうか?
  • コントロールを利用したウェブページが、システムを不安定にしたり応答なしに陥れる原因になったりはしませんか?
  • コントロールはユーザーにそれと知らせずスパイ行為をしませんか?
  • コントロールを使ってクロスサイトスクリプティング攻撃ができないでしょうか?
  • コントロールは独自形式のデータを読み込みませんか?そのデータ形式は独自のしかたでセキュリティを実装していませんか?データ型がマクロをサポートしていませんか?
  • 履歴、統計、デバッグ情報をローカルコンピューターに保存していませんか?プライバシーに敏感なユーザーはこれを消去できますか?ネットワークにデータを送出したりしませんか? GUID でユーザーをトラッキングしたりしませんか?

以下は、コントロールを設計するときに考えるべき、より一般的な質問です。

  • ネットワークから受け取る文字列を、検証したり解析したり、フィルタリングしたりするでしょうか?文字列をつかって何をするのでしょうか?文字列にスクリプトが混入しているとどうなりますか?別のコンポーネントにその文字列を渡すとどうなるでしょうか?
  • バッファオーバーランが起きそうな場所はありますか?すべてのメソッド、プロパティ、イベントに対し、バッファオーバーラン用の完全なテストはしましたか?
  • 外部サイトがコントロールを起動しようとしたとき、それを止めるために何か対策をしていますか?
  • "safe for scripting" もしくは "safe for initialization" とマークしなかったら、コントロールが果たすべき役目が阻害されるでしょうか?デフォルトではマークされません。セーフとマークしなければ役目を果たせない、というのでなければ、そう実装しないでください。
  • コントロールはユーザーがそう望んだときに、信頼してよいと確認できる情報を提示できますか?デジタル署名をしましたか?

How to Judge control Security
The security of a control is ultimately a subjective judgment. The following questions are designed to help you think about the security of your control. You can use them as part of your larger security review.

  • Can you limit domain usage or zone usage? See the section on site-locking your control for more information.
  • Are you exposing the user's private information over the network or to other users?
  • Can you read, write, create, detect or delete arbitrary persisted data either on the file system, the registry, a buddy list, or a camera or other USB devices?
  • Does this control enable data to passing from one Internet site to another? From the intranet to the Internet? From the local computer to the Internet?
  • Can this control host mobile code or script? If so, where does the code or script come from?
  • Does the control cause arbitrary operations or programs to execute on behalf of the user without notice?
  • Does this control circumvent/defeat a specific security feature in the browser, operating system, or another application?
  • Can a Web page use this control to cause the system to become unstable or stop responding?
  • Can this control be used to spy on the user without their knowledge?
  • Is there a possibility for cross-site scripting attacks using this control?
  • Does this control load its own data format? Does this data type have its own security implementation? Does this data type allow macros?
  • Is history, statistical, or debugging information persisted on the local computer? Can a privacy conscious user clear this information? Is the information ever sent over the network? Are globally unique identifiers (GUIDs) used to track users?

These are some other general questions that you should consider as you design your control.

  • Are strings from the network validated, parsed, or filtered? What happens with the strings? What would happen if they contain script? What happens to the strings after they are passed on to another component?
  • Where might there be buffer overruns? Have you done full testing for buffer overruns on all methods, properties, and events?
  • What are you doing to stop an extraneous Web site from invoking the control?
  • If you don't mark the control "safe for scripting" or "safe for initialization", does that disable the purpose of the control? Controls are marked as not safe for scripting or data initialization by default. Don't implement them unless the functionality of the control is hampered without them.
  • Does the control present information to the user such that they can always identify its authenticity? Do you digitally sign the control?
Internet Explorer for Developers | Microsoft Docs