security(push): sanitize message-editor content before rendering into the editor - #7969
Closed
ar2rsawseen wants to merge 1 commit into
Closed
security(push): sanitize message-editor content before rendering into the editor#7969ar2rsawseen wants to merge 1 commit into
ar2rsawseen wants to merge 1 commit into
Conversation
…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>
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #7968 to
release.24.05.The push message editor set the composed message as
innerHTMLon a livecontenteditableelement. This routes it throughcountlyCommon.encodeSomeHtmlwith 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
idis 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