Skip to content

fix: ESI/fragments を既定で無効化する - #7071

Open
nanasess wants to merge 1 commit into
EC-CUBE:4.4from
nanasess:feature/disable-esi-fragments
Open

fix: ESI/fragments を既定で無効化する#7071
nanasess wants to merge 1 commit into
EC-CUBE:4.4from
nanasess:feature/disable-esi-fragments

Conversation

@nanasess

@nanasess nanasess commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

概要

EC-CUBE コアはブロック描画に inline フラグメントレンダラ ({{ render(path(...)) }}) のみを使用しており、ESI / hinclude レンダラや fragments リスナー(公開エンドポイント /_fragment)を利用していません。未使用のまま既定で有効化しておくと /_fragment が露出するため、既定で無効化して攻撃面を削減します。

変更内容

app/config/eccube/packages/framework.yamlesi / fragmentsenabled: false に変更しました。

影響調査

  • コア(src/Eccube)およびテンプレートで render_esi() / render_hinclude() / esi:include / hx:include の使用なし
  • HttpCache / Surrogate など ESI ゲートウェイの登録なし
  • 無効化後も inline レンダラ(fragment.renderer.inline)と fragment.handler は維持され、ブロック描画は従来通り動作
  • cache:clear(prod) が正常完了(コンパイルエラーなし)
  • 無効化により除去されるのは fragment.listener(/_fragment) と、未使用の fragment.renderer.esi / fragment.renderer.hinclude のみ

有効化が必要なケース

render_esi() / render_hinclude() を HTTP キャッシュ(ESI)ゲートウェイと組み合わせて使うプロジェクトは、個別に enabled: true へ戻してください。

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 変更
    • フラグメント機能の設定を見直し、インライン方式で処理するよう変更しました。
    • フラグメント用の公開エンドポイントを無効化し、不要な外部アクセスを防止します。

EC-CUBE コアはブロック描画に inline フラグメントレンダラ
({{ render(path(...)) }}) のみを使用しており、ESI/hinclude レンダラや
fragments リスナー(公開エンドポイント /_fragment)を利用していない。
未使用の機能を既定で有効にしておくと /_fragment が露出するため、
既定で無効化して攻撃面を削減する。

- コアの表示・機能への影響なし (inline レンダラと fragment.handler は維持、
  cache:clear も正常)
- render_esi() / render_hinclude() と HTTP キャッシュ(ESI)ゲートウェイを
  使うプロジェクトのみ、個別に有効化する

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fd118c3-7f42-41d6-aa5d-d8f8688ff3a0

📥 Commits

Reviewing files that changed from the base of the PR and between f03d0da and 256a576.

📒 Files selected for processing (1)
  • app/config/eccube/packages/framework.yaml

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

ESI とフラグメントを無効化しました。インラインフラグメントレンダラーを使用する設定に変更しました。/_fragment エンドポイントを公開しない方針をコメントで示しました。

Changes

フラグメント設定

Layer / File(s) Summary
ESI とフラグメントの無効化
app/config/eccube/packages/framework.yaml
ESI とフラグメントを enabled: false に変更しました。インラインフラグメントレンダラーを使用する設定と、ESI ゲートウェイが必要な場合だけ有効化する条件をコメントで追加しました。

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 256a5

This change disables unused ESI and fragment endpoints by default while preserving inline block rendering, reducing exposed attack surface without a known functional impact. No actionable merge-blocking risk remains after normal checks and review.

Poem

うさぎが設定をぴょんと変更、
ESI の扉をそっと閉じ、
フラグメントもお休み中。
インライン描画で軽やかに、
にんじん片手に確認です。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは、ESIとフラグメント機能を既定で無効化する主な変更内容を明確かつ簡潔に示しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nanasess nanasess added this to the 4.4.0 milestone Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.64%. Comparing base (f03d0da) to head (256a576).

Additional details and impacted files
@@            Coverage Diff             @@
##              4.4    #7071      +/-   ##
==========================================
- Coverage   77.67%   77.64%   -0.03%     
==========================================
  Files         597      597              
  Lines       29333    29333              
==========================================
- Hits        22785    22777       -8     
- Misses       6548     6556       +8     
Flag Coverage Δ
Unit 77.64% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants