Skip to content

Improve handling of HTML comments in remote content - #3865

Merged
pfefferle merged 2 commits into
trunkfrom
fix/harden-imported-content
Oct 9, 2026
Merged

pfefferle merged 2 commits into
trunkfrom
fix/harden-imported-content

Conversation

@pfefferle

Copy link
Copy Markdown
Member

Split out of #3850.

Proposed changes:

  • Remote posts and replies now have their HTML comments removed more thoroughly. An unclosed <!-- is removed up to the end of the content, and each removed comment is replaced by a space, so the text around it stays separate.
  • The removal runs again after the HTML is cleaned, in Sanitize::content() and Sanitize::comment_content().

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Run npm run env-test -- --filter Test_Sanitize.
  • Reply to a federated post from Mastodon and check that the reply still shows up as expected.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Improve the safety of imported Fediverse posts and comments.

The entry is already part of the branch.

@pfefferle pfefferle self-assigned this Oct 9, 2026
@pfefferle
pfefferle requested a review from a team October 9, 2026 11:08
@pfefferle
pfefferle merged commit f8b385d into trunk Oct 9, 2026
11 checks passed
@pfefferle
pfefferle deleted the fix/harden-imported-content branch October 9, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant