Cross-Site Scripting警告の解消#1740
Conversation
- html_escape() でユーザー入力データを適切にエスケープ - sanitize_url() でリンク先URLを安全化 - link_to に noreferrer を追加し Reverse Tabnabbing 対策
- docs/show.html.erb と podcasts/show.html.erb で raw() を sanitize_content() ヘルパーに変更 - ApplicationHelper に sanitize_content() メソッドを追加し、HTML サニタイズ処理を共通化 - Rails デフォルトに加えて 'center' タグと 'id' 属性を許可してコンテンツを適切に表示 - docs_spec.rb のテスト期待値にも同じサニタイズ処理を適用
|
@claude このPRについて、以下の観点でレビューしてください:
|
|
Claude finished @nacchan99's task —— View job タスクリスト
PR レビュー結果XSS脆弱性の修正PRをレビューしました。以下の観点でフィードバックをお伝えします。
|
- Dojoモデルのsafe_urlメソッドをApplicationHelperのsafe_dojo_urlに移動 - app/views/shared/_dojo.html.erbでsafe_dojo_url()ヘルパーを使用
|
@claude 再度、簡単なレビューをお願いします! |
|
Claude finished @nacchan99's task —— View job タスクリスト
PR レビュー結果前回のフィードバックを反映した修正を確認しました。以下の観点でレビューします。 ✅ 良い実装 (参考になる箇所)1.
|
|
以前いただいたコメント #1704 (comment) を今思い出したので、 |
- link_to の rel="external noopener noreferrer" を削除 - Brakemanで警告なし、RSpecテストも全て通過済み
2bd6d5d to
70c8b5f
Compare
|
@claude Review this PR if we can merge or need additional commits to merge? ultrathink |
|
Claude finished @yasulab's task —— View job タスクリスト
PR レビュー結果XSS脆弱性修正のPRを確認しました。全体的に適切な修正が実施されており、マージして問題ありません。
|
|
@claude Your comment seems outdated and hallucination-ish? Modern browsers already fix this by default in my understanding? think
|
|
Claude finished @yasulab's task —— View job タスクリスト
@yasulab さん、ご指摘ありがとうございます。おっしゃる通りです。
|
|
PR のご対応ありがとうございました!!こちらマージしますね...!! 🚀✨ |
| <iframe class="lazyload" src="https://anchor.fm/coderdojo-japan/embed/episodes/<%= @episode.permalink %>" width="100%" scrolling="no" frameborder="yes" style='margin-bottom: 30px;'></iframe> | ||
|
|
||
| <%= raw Rinku.auto_link(@content) %> | ||
| <%= sanitize_content(Rinku.auto_link(@content)) %> |
There was a problem hiding this comment.
あーーー、これページのレイアウトが壊れちゃう変更でした... 😭💦 (マージ後すぐに気づけてよかった...!! ✅✨) https://coderdojo.jp/signup#terms
まずは自分の方で /signup ページに対する layout break を検知できるテストを追加 して、その後、一旦 revert しますね! 🙇 🙇 🙇
There was a problem hiding this comment.
まずは自分の方で
/signupページに対する layout break を検知できるテストを追加
Committed. ✅ 74a3ed3
There was a problem hiding this comment.
失礼しました🙏💦
ご対応ありがとうございます!!
cf. #1727
cf. #1729
cf. #1736
cf. #1737
config/brakeman.ignoreに登録されていたCross-Site Scriptingの警告を解消しました!やったこと
app/views/shared/_dojo.htmlにて、HTML を正しく表示するために html_safe を適用