Skip to content

[WEB-10184] fix: sanitize page description HTML on write - #10313

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10184-sanitize-page-html
Nov 16, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10184-sanitize-page-html

Conversation

@pablohashescobar

Copy link
Copy Markdown
Member

Description

Page description_html reached the database without passing through the HTML sanitiser on two write paths: page create (PageSerializer.create took the value from serializer context) and page update (PageDetailSerializer.description_html was a plain writable field). The collaboration save path already sanitises.

  • PageSerializer.create runs the description through validate_html_content.
  • PageDetailSerializer gets a validate_description_html that 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_html on page create now returns 400.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

  • New 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.
  • Suggested: create a page through the API with ordinary editor HTML (headings, lists, an image) and confirm it is stored unchanged.

References

  • WEB-10184

Created with Claude Code

Page create and update now pass description_html through the shared HTML
sanitiser, as the page description endpoint and work item serializers do.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc016895-6cf2-4d85-ab81-2e32baa5bad9
Commits

Reviewing files that changed from the base of the PR and between 290383d and 32c9155.

Files selected for processing: 2

  • apps/api/plane/app/serializers/page.py
  • apps/api/plane/tests/contract/app/test_rich_text_sanitization_app.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@makeplane

makeplane Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@pablohashescobar pablohashescobar changed the title [WEB-10184] fix(security): sanitize page description HTML on write [WEB-10184] fix: sanitize page description HTML on write Nov 16, 2026

@sriramveeraghanta sriramveeraghanta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sriramveeraghanta
sriramveeraghanta merged commit f6c44c6 into preview Nov 16, 2026
19 of 20 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/web-10184-sanitize-page-html branch November 16, 2026 20:24
sriramveeraghanta pushed a commit that referenced this pull request Nov 16, 2026
Page create and update now pass description_html through the shared HTML
sanitiser, as the page description endpoint and work item serializers do.
Pawel-Kranzberg pushed a commit to klazwi/pi-plane that referenced this pull request Nov 18, 2026
…0313)

Page create and update now pass description_html through the shared HTML
sanitiser, as the page description endpoint and work item serializers do.

(cherry picked from commit 4b0901d)
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.

3 participants