Skip to content

security(push): sanitize message-editor content before rendering into the editor - #7969

Closed
ar2rsawseen wants to merge 1 commit into
release.24.05from
backport/push-editor-sanitize-2405
Closed

security(push): sanitize message-editor content before rendering into the editor#7969
ar2rsawseen wants to merge 1 commit into
release.24.05from
backport/push-editor-sanitize-2405

Conversation

@ar2rsawseen

Copy link
Copy Markdown
Member

Backport of #7968 to release.24.05.

The push message editor set the composed message as innerHTML on a live contenteditable element. This routes it through countlyCommon.encodeSomeHtml with an allowlist restricted to the user-property token <span> and the attributes it depends on (class, id, contenteditable, data-user-property-*); any other markup is escaped to inert text.

Display is unchanged for normal messages, and the token id is preserved so the editor's per-token event wiring keeps working. Same change as master, applied on identical surrounding code.

Note: a quick manual check of composing/editing a notification with a personalization token is worthwhile before merge.

🤖 Generated with Claude Code

…contenteditable

The push message editor set the composed message as innerHTML on a live
contenteditable. Sanitize that content with countlyCommon.encodeSomeHtml, allowing only
the user-property token span (and the attributes it relies on: class, id, contenteditable,
data-user-property-*) and escaping any other markup to inert text. The message body is
user text and the token element is the only legitimate markup, so display is unchanged for
normal messages; the token id is preserved so the editor's per-token event wiring keeps
working.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ar2rsawseen

Copy link
Copy Markdown
Member Author

Superseded by #7971, which consolidates the frontend HTML-sink hardening into a single per-repo PR. The same change (same authorship) is included there. Closing this one.

@ar2rsawseen
ar2rsawseen deleted the backport/push-editor-sanitize-2405 branch August 19, 2026 14:17
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.

1 participant