LoginSignup
9
9

More than 5 years have passed since last update.

【webkit】iframeを含むテキストをフォームで送信すると何も表示されない

Last updated at Posted at 2013-11-04

webkitのX-XSS-Protectionの地雷のようです

iframeを含むテキスト(youtubeの埋め込みリンクetc)をフォームで
送信してそれを表示させようとすると、safariではabout:blank, chromeではdata:,としか表示されません
webkitのX-XSS-Protectionに引っかかって無効化されてしまうようです

回避するには、HTTPリクエストヘッダで
X-XSS-Protection:0とすれば良いです
Railsで実装するならならこんな感じ

some_controller.rb
response.headers["X-XSS-Protection"] = "0"

X-XSS-Protectionが無効になってしまうため、管理画面でしか使わないとか、
同じドメインだった時のみ無効化するとか、セキュリティに
気をつける必要があります

chromiumのissueにも上がっていますが未解決のようです
Reflective XSS Protection appears to target legitimate iframes as a false positive
https://code.google.com/p/chromium/issues/detail?id=98787

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9