Skip to content

【管理画面】コンテンツ情報の表示でエスケープされていない値がある問題を解決 - #4660

Merged
ryuring merged 2 commits into
5.4.xfrom
fix/content-info-escape
Nov 22, 2026
Merged

ryuring merged 2 commits into
5.4.xfrom
fix/content-info-escape

Conversation

@ryuring

@ryuring ryuring commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

概要

検証環境での脆弱性スキャン(VAddy)で、固定ページ編集の送信値 content[id] が編集画面にエスケープされずに表示される箇所が見つかったため修正しました。

実際の環境では CSRF 対策(CsrfProtectionMiddleware / FormProtection)により外部から送信値を誘導できないため、脆弱性としては扱わず通常の修正としています。

変更内容

  • content_info.php:コンテンツ ID・実体 ID・データ作成日・データ更新日の表示を h() でエスケープ
  • content_fields.php:公開期間(公開開始日・終了日)の表示を h() でエスケープ
  • Content エンティティ:既存のコンテンツについて、id・plugin・type・entity_id を一括代入不可とする
    • 編集フォームの送信値でこれらを書き換えられると、別のコンテンツを指したり、種類に不正な値が入って以後そのコンテンツの編集・削除ができなくなったりするため
    • 新規作成時は従来どおり代入可能

テスト

  • ContentTest を追加(新規は代入可、既存は送信値で書き換わらないこと)
  • baser-core(Service / Controller / Model)、bc-mail、bc-content-link、bc-custom-content を実行。失敗はローカル環境の URL 設定などに起因する既存のもののみ(bc-blog は全体実行するとローカル環境で多数のエラーとなるが、変更前のコードでも同様であることを確認)

🤖 Generated with Claude Code

固定ページ等の編集画面で、送信値のコンテンツ ID などをエスケープせずに
表示していたため、エスケープするよう修正。
あわせて、既存コンテンツの ID・プラグイン・種類・紐付け先は送信値で
書き換えられないようにした。

- コンテンツ情報(コンテンツ ID・実体 ID・作成日・更新日)と、
  公開期間の表示を h() でエスケープ
- Content エンティティで、既存のコンテンツの id・plugin・type・entity_id を
  一括代入不可とする(新規作成時は従来どおり)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 22, 2026 06:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@ryuring
ryuring merged commit c4b5d50 into 5.4.x Nov 22, 2026
5 checks passed
@ryuring
ryuring deleted the fix/content-info-escape branch November 22, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants