Skip to content
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

ファイルアップロードの失敗時にエラー内容自体を表示しないように修正 #5566

Merged
merged 2 commits into from
Aug 24, 2022

Conversation

takeuji
Copy link
Contributor

@takeuji takeuji commented Aug 18, 2022

概要(Overview・Refs Issue)

#5561のissueに対応しました。

方針(Policy)

出力されていた内容である、phpの一時ファイルのパスやドキュメントルートのパスは
システム情報から閲覧可能ですが、「システム設定」などへの権限のない運用者にもこの画面で見えてしまうため
ここでのメッセージは固定文言のみとし、原因調査のためこれまでのメッセージはログに出力するようにしました。

実装に関する補足(Appendix)

テスト(Test)

相談(Discussion)

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更はありません
  • フックポイントの呼び出しタイミングの変更はありません
  • フックポイントのパラメータの削除・データ型の変更はありません
  • twigファイルに渡しているパラメータの削除・データ型の変更はありません
  • Serviceクラスの公開関数の、引数の削除・データ型の変更はありません
  • 入出力ファイル(CSVなど)のフォーマット変更はありません

レビュワー確認項目

  • 動作確認
  • コードレビュー
  • E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
  • 互換性が保持されているか
  • セキュリティ上の問題がないか
    • 権限を超えた操作が可能にならないか
    • 不要なファイルアップロードがないか
    • 外部へ公開されるファイルや機能の追加ではないか
    • テンプレートでのエスケープ漏れがないか

@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2022

Codecov Report

Merging #5566 (5a6b62b) into 4.2 (c3ecb92) will decrease coverage by 0.00%.
The diff coverage is 60.00%.

@@             Coverage Diff              @@
##                4.2    #5566      +/-   ##
============================================
- Coverage     78.83%   78.82%   -0.01%     
- Complexity     6253     6260       +7     
============================================
  Files           469      469              
  Lines         20992    21008      +16     
============================================
+ Hits          16548    16559      +11     
- Misses         4444     4449       +5     
Flag Coverage Δ
E2E 64.75% <20.00%> (-0.02%) ⬇️
Unit 77.53% <75.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...Eccube/Controller/Admin/Content/FileController.php 84.80% <60.00%> (-2.34%) ⬇️
src/Eccube/Entity/Order.php 92.15% <0.00%> (+0.04%) ⬆️
...ervice/PurchaseFlow/Processor/PaymentValidator.php 97.36% <0.00%> (+0.39%) ⬆️
...be/Service/PurchaseFlow/Processor/TaxProcessor.php 82.45% <0.00%> (+3.50%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chihiro-adachi chihiro-adachi added this to the 4.2.0 milestone Aug 18, 2022
@chihiro-adachi
Copy link
Contributor

@takeuji
#5561 自体の修正は、#5565 を採用させていただきました。

以下はユーザに提示したいエラーメッセージではあるので、すべて固定表示にするのは適切でないように思います。
https://github.com/EC-CUBE/ec-cube/blob/4.2/src/Eccube/Controller/Admin/Content/FileController.php#L187
https://github.com/EC-CUBE/ec-cube/blob/4.2/src/Eccube/Controller/Admin/Content/FileController.php#L300-L307

既存の作りの問題ではあるのですが、コントローラで意図的に投げている例外とシステムが投げる例外とで切り分けができるとよいかなと思いました。

@takeuji
Copy link
Contributor Author

takeuji commented Aug 22, 2022

@chihiro-adachi
ご指摘ありがとうございました。
try-catchを分けるように修正しました。

@carkn carkn added the bugbounty2022:pr:entry バグバウンティ2022 バグ登録 PR登録 label Aug 23, 2022
@chihiro-adachi
Copy link
Contributor

@takeuji
ありがとうございます。修正もんだいないかと思います。

@chihiro-adachi chihiro-adachi merged commit 1a1d4f7 into EC-CUBE:4.2 Aug 24, 2022
@chihiro-adachi chihiro-adachi added the bugbounty2022:pr:recognition バグバウンティ2022 バグ登録 PR取込 label Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:Low bugbounty2022:pr:entry バグバウンティ2022 バグ登録 PR登録 bugbounty2022:pr:recognition バグバウンティ2022 バグ登録 PR取込
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants