Zend Framework 1.9(一部日本語)1.9.0 よりも前にリリースされた Zend Framework から 1.9 のどのリリースに更新する際でも、 下記の移行上の注意点に注意すべきです。 Zend_File_TransferMimeType の検証セキュリティ上の理由から、 MimeType、ExcludeMimeType、 IsCompressed および IsImage バリデータにおけるデフォルトのフォールバック機能を無効にしました。 つまり、fileInfo 拡張モジュールあるいは magicMime 拡張モジュールがなければ、 検証が常に失敗するようになるということです。 ユーザ側から渡された HTTP フィールドを使用して入力を検証する必要がある場合は、 enableHeaderCheck() メソッドを使用すればこの機能を有効にできます。
Example #1 HTTP フィールドの使用を許可する
Zend_Filter1.9のリリース以前は、Zend_Filterでは、 static get()メソッドを使うことができました。 リリース1.9と同時に、このメソッドは、より描写的な filterStatic()に名前を変更されました。 古い get() メソッドは非推奨に区分されます。 Zend_Http_Client内部のアップロードされたファイル情報ストレージに変更Zend Framework のバージョン 1.9 では、 アップロードされるファイルに関する情報を Zend_Http_Clientが内部的に格納し、 Zend_Http_Client::setFileUpload()メソッドを用いてセットする 方法で変化がありました。 複数のファイルを同じフォーム名で ファイルの配列としてアップロードできるように この変化が取り入れられました。 この問題に関するより多くの情報は、» このバグ・レポート で見つけられます。 Example #2 アップロードされたファイル情報の内部ストレージ
ご覧の通り、この変化は1つ以上のファイルで同じフォーム要素名を使えるようにします。 しかし、それは微妙な下位互換性変化を取り入れるので、そのように注意するべきです。 Zend_Http_Client::_getParametersRecursive() の廃止バージョン1.9から始まりますが、 protected メソッド _getParametersRecursive() はもはや Zend_Http_Client に使われず、廃止されます。 それを使うと、 E_NOTICE メッセージがPHPによって発生する原因になります。 Zend_Http_Clientをサブクラスとして、このメソッドを呼ぶなら、 その代わりに Zend_Http_Client::_flattenParametersArray() static メソッドを使用することに目を向けるべきです。 また、この _getParametersRecursiveは protected メソッドなので、 この変化はZend_Http_Clientをサブクラスとするユーザーに 影響を及ぼすだけです。 Zend_Locale非推奨となるメソッド特別に用意されていたメソッドのいくつかが非推奨となります。 既存の挙動と重複しているからです。 古いメソッドも動作するにはしますが、 新しいメソッドについて説明する user notice が発生することに注意しましょう。 これらのメソッドは 2.0 で削除されます。 次の一覧で、新旧のメソッドコールを参照ください。
1.9.7 でのセキュリティーフィックスAdditionally, users of the 1.9 series may be affected by other changes starting in version 1.9.7. These are all security fixes that also have potential backwards compatibility implications. Zend_Dojo_View_Helper_EditorA slight change was made in the 1.9 series to modify the default usage of the Editor dijit to use div tags instead of a textarea tag; the latter usage has » security implications, and usage of div tags is recommended by the Dojo project. In order to still allow graceful degradation, a new degrade option was added to the view helper; this would allow developers to optionally use a textarea instead. However, this opens applications developed with that usage to XSS vectors. In 1.9.7, we have removed this option. Graceful degradation is still supported, however, via a noscript tag that embeds a textarea. This solution addressess all security concerns. The takeaway is that if you were using the degrade flag, it will simply be ignored at this time. Zend_Filter_HtmlEntitiesよりセキュアな文字エンコードを既定値にするために、 Zend_Filter_HtmlEntities は、 ISO-8859-1 の代わりに UTF-8 を既定値にしました。 Additionally, because the actual mechanism is dealing with character encodings and not character sets, two new methods have been added, setEncoding() and getEncoding(). The previous methods setCharSet() and setCharSet() are now deprecated and proxy to the new methods. Finally, instead of using the protected members directly within the filter() method, these members are retrieved by their explicit accessors. If you were extending the filter in the past, please check your code and unit tests to ensure everything still continues to work. Zend_Filter_StripTagsZend_Filter_StripTags contains a flag, commentsAllowed, that, in previous versions, allowed you to optionally whitelist HTML comments in HTML text filtered by the class. However, this opens code enabling the flag to XSS attacks, particularly in Internet Explorer (which allows specifying conditional functionality via HTML comments). Starting in version 1.9.7 (and backported to versions 1.8.5 and 1.7.9), the commentsAllowed flag no longer has any meaning, and all HTML comments, including those containing other HTML tags or nested commments, will be stripped from the final output of the filter.
|
|