unserialize() に allowed_classes オプションを追加#6622
Conversation
セキュリティ診断で指摘された、unserialize() の allowed_classes 未指定の 問題を修正。非会員フローでセッションに保存される CustomerAddress の デシリアライズ時に、許可するクラスを明示的に指定することで、 オブジェクトインジェクション攻撃のリスクを軽減する。 fix EC-CUBE#6620 Co-Authored-By: Claude Opus 4.6 <[email protected]>
📝 WalkthroughWalkthroughセッションデータから非会員顧客住所を復元する際の Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.3 #6622 +/- ##
============================================
- Coverage 82.70% 78.84% -3.87%
- Complexity 0 6631 +6631
============================================
Files 480 475 -5
Lines 26507 26539 +32
============================================
- Hits 21923 20925 -998
- Misses 4584 5614 +1030
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@nobuhiko |
Summary
unserialize()のallowed_classes未指定の問題を修正CustomerAddressのデシリアライズ時に、許可するクラスを明示的に指定修正内容
ShippingMultipleController.php: 非会員のお届け先追加時のunserialize()にallowed_classesを追加ShippingMultipleItemType.php: 非会員の配送先リスト構築時のunserialize()にallowed_classesを追加Generator.php(テストフィクスチャ): 同様の修正を適用allowed_classes に含めるクラス
CustomerAddress— メインのエンティティCustomer— 顧客エンティティPref— 都道府県マスタCountry— 国マスタfix #6620
Test plan
bin/phpunit tests/Eccube/Tests/Web/ShoppingControllerWithMultipleNonmemberTest.phpで非会員複数配送テスト実行bin/phpunit tests/Eccube/Tests/Web/ShoppingControllerWithNonmemberTest.phpで非会員テスト実行🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート