Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Enterprise Fixes:
- [data-manager] Fixed editing an event whose key contains `&` creating undeletable duplicate rows in the events table

Security Fixes:
- [push] The message editor now sanitizes message content before rendering it into the editor, allowing only the user-property token element and rendering any other markup as text
- [hooks] Internal event hooks are now scoped to the apps the hook belongs to: app creation is a global-admin-only event, and remote-config, cohort, alert and hook-chaining events are only delivered when the event's app is one the hook is scoped to
- [compliance-hub] The consents table now returns a fixed set of fields; a projection supplied on the request is no longer used to widen the response beyond the consent columns
- [dashboards] Widgets are no longer copied when the copying user has no access to the apps they reference, and widget app ids are validated on widget create and update
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
/* eslint-disable no-console */
/*global CV,countlyVue,countlyPushNotification,countlyGlobal,countlyCommon,moment*/
(function(countlyPushNotificationComponent) {
// The message editor is a live contenteditable. Its body is user-authored text; the
// only legitimate markup is the user-property token <span>. Allow just that element
// (with the attributes the token relies on) and let everything else be escaped to inert
// text, so a stored message cannot introduce active markup when the editor is populated.
var PUSH_MESSAGE_EDITOR_XSS_OPTIONS = {
whiteList: {
span: ["class", "id", "contenteditable", "data-user-property-label", "data-user-property-value", "data-user-property-fallback"]
}
};
countlyPushNotificationComponent.LargeRadioButtonWithDescription = countlyVue.views.create({
props: {
value: {
Expand Down Expand Up @@ -706,7 +715,7 @@
},
reset: function(htmlContent, ids) {
this.disconnectMutationObserver();
this.$refs.element.innerHTML = htmlContent;
this.$refs.element.innerHTML = countlyCommon.encodeSomeHtml(htmlContent, PUSH_MESSAGE_EDITOR_XSS_OPTIONS);
this.addEventListeners(ids);
this.startMutationObserver();
},
Expand Down
Loading