-
-
Notifications
You must be signed in to change notification settings - Fork 109
Cross-Site Scripting警告の解消 #1740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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
cf. #1727
cf. #1729
cf. #1736
cf. #1737
config/brakeman.ignore
に登録されていたCross-Site Scripting
の警告を解消しました!やったこと
app/views/shared/_dojo.html
にて、HTML を正しく表示するために html_safe を適用