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

想定しない脆弱性を防ぐため default modifier に HTMLPurifier を適用する #1066

Merged
merged 9 commits into from
Dec 23, 2024

Conversation

nanasess
Copy link
Contributor

@nanasess nanasess commented Nov 22, 2024

fixes #710

想定しない脆弱性を防ぐため default modifier に HTMLPurifier を適用する。
サニタイズされる内容が既存のコンテンツに悪影響を与えないかどうか要検証。

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.63%. Comparing base (320b42e) to head (f40844e).
Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1066      +/-   ##
==========================================
- Coverage   51.70%   51.63%   -0.07%     
==========================================
  Files          80       80              
  Lines       10223    10223              
==========================================
- Hits         5286     5279       -7     
- Misses       4937     4944       +7     
Flag Coverage Δ
tests 51.63% <ø> (-0.07%) ⬇️

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

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

@nanasess nanasess marked this pull request as draft November 22, 2024 08:18
@nanasess
Copy link
Contributor Author

サニタイズされる内容が既存のコンテンツに悪影響を与えないかどうか要検証。

  • mtb_allowed_tag によって許可されているタグは、HTMLPurifier でも許可タグとなっているため削除されないことを確認済
  • その他、input タグや textarea タグなど、許可タグ以外は HTMLPurifier によって削除されてしまうが、2.17 より HTML をそのまま出力する Smarty 変数は明示的に nofilter を付与するようにしているため、大きな影響は無いと思われる

id 属性が重複するとよろしくないが、厳密にサニタイズするよりも後方互換
性を優先する
@nanasess nanasess marked this pull request as ready for review November 23, 2024 14:54
@nanasess nanasess enabled auto-merge November 23, 2024 14:59
@nanasess nanasess added this to the 2.18(仮) milestone Dec 16, 2024
@nanasess nanasess merged commit 664860e into EC-CUBE:master Dec 23, 2024
108 of 109 checks passed
@nanasess nanasess deleted the use-htmlpurifier branch December 23, 2024 05:51
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.

ezyang/htmlpurifier の導入
2 participants