Repository navigation
[WEB-10184] fix: sanitize page description HTML on write - #10313
Conversation
Page create and update now pass description_html through the shared HTML sanitiser, as the page description endpoint and work item serializers do.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
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. |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
sriramveeraghanta
left a comment
There was a problem hiding this comment.
LGTM. It uses the same validate_html_content allowlist the live-server save path already applies. Follow-up, pre-existing and not caused by this PR: CUSTOM_TAGS in content_validator.py lacks issue-embed-component, so work-item embeds get stripped. Page duplicate already loses them, because it copies the stored HTML with description_binary=None.
Page create and update now pass description_html through the shared HTML sanitiser, as the page description endpoint and work item serializers do.
Description
Page
description_htmlreached the database without passing through the HTML sanitiser on two write paths: page create (PageSerializer.createtook the value from serializer context) and page update (PageDetailSerializer.description_htmlwas a plain writable field). The collaboration save path already sanitises.PageSerializer.createruns the description throughvalidate_html_content.PageDetailSerializergets avalidate_description_htmlthat does the same.Public-board comments needed no change: the space view uses the web API's comment serializer, which already sanitises. The test file includes a guard for that.
Behavior change: a non-string
description_htmlon page create now returns 400.Type of Change
Screenshots and Media (if applicable)
Test Scenarios
plane/tests/contract/app/test_rich_text_sanitization_app.py: a page created or updated with a script element and an inline event handler is stored without them (both fail without the fix); a public-board comment is already sanitised. 3 passed.References
Created with Claude Code