From 27ddd77a1b621f503fe89a436a49f44b0b1204b5 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Thu, 21 Apr 2022 11:27:28 +0530 Subject: [PATCH] chore: Sanitize html content (#4498) --- .../components/widgets/conversation/ReplyBox.vue | 2 +- .../components/widgets/conversation/bubble/Text.vue | 2 +- .../contact/components/MergeContactSummary.vue | 4 ++-- .../modules/notes/components/ContactNote.vue | 2 +- app/javascript/dashboard/routes/auth/Signup.vue | 2 +- .../conversation/ContactCustomAttributes.vue | 4 +++- .../conversation/search/SearchMessageItem.vue | 2 +- .../dashboard/settings/SettingsSubPageHeader.vue | 2 +- .../routes/dashboard/settings/agents/Index.vue | 2 +- .../settings/attributes/CustomAttribute.vue | 2 +- .../routes/dashboard/settings/automation/Index.vue | 2 +- .../routes/dashboard/settings/canned/Index.vue | 2 +- .../routes/dashboard/settings/inbox/Index.vue | 2 +- .../integrationapps/MultipleIntegrationHooks.vue | 2 +- .../settings/integrations/IntegrationHelpText.vue | 4 +++- .../dashboard/settings/integrations/Webhook.vue | 2 +- .../routes/dashboard/settings/labels/Index.vue | 2 +- .../routes/dashboard/settings/teams/Index.vue | 2 +- app/javascript/packs/application.js | 3 ++- app/javascript/packs/widget.js | 2 ++ .../shared/components/emoji/EmojiInput.vue | 4 ++-- .../widget/components/AgentMessageBubble.vue | 2 +- app/javascript/widget/components/ChatHeader.vue | 2 +- .../widget/components/ChatHeaderExpanded.vue | 6 +++--- app/javascript/widget/components/UnreadMessage.vue | 5 ++++- .../widget/components/UserMessageBubble.vue | 2 +- package.json | 1 + yarn.lock | 12 ++++++++++++ 28 files changed, 52 insertions(+), 29 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue index 99321eff8d4d..ae2b83f2a93e 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue @@ -80,8 +80,8 @@ >

{{ $t('CONVERSATION.FOOTER.MESSAGE_SIGNATURE_NOT_CONFIGURED') }} diff --git a/app/javascript/dashboard/components/widgets/conversation/bubble/Text.vue b/app/javascript/dashboard/components/widgets/conversation/bubble/Text.vue index 1bd16d9d5a27..bf21d535e9ea 100644 --- a/app/javascript/dashboard/components/widgets/conversation/bubble/Text.vue +++ b/app/javascript/dashboard/components/widgets/conversation/bubble/Text.vue @@ -6,7 +6,7 @@ 'hide--quoted': !showQuotedContent, }" > -

+
diff --git a/app/javascript/widget/components/UserMessageBubble.vue b/app/javascript/widget/components/UserMessageBubble.vue index 073766545728..b0285b8074fc 100755 --- a/app/javascript/widget/components/UserMessageBubble.vue +++ b/app/javascript/widget/components/UserMessageBubble.vue @@ -1,8 +1,8 @@ diff --git a/package.json b/package.json index da44aecb23fc..9c249cf70d7c 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "vue-chartjs": "3.5.1", "vue-clickaway": "~2.1.0", "vue-color": "2.8.1", + "vue-dompurify-html": "^2.5.1", "vue-easytable": "2.5.5", "vue-i18n": "8.24.3", "vue-loader": "15.9.6", diff --git a/yarn.lock b/yarn.lock index c32b9fc7b686..959b40c3f468 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5843,6 +5843,11 @@ dompurify@2.2.7: resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.2.7.tgz#a5f055a2a471638680e779bd08fc334962d11fd8" integrity sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg== +dompurify@^2.3.4: + version "2.3.6" + resolved "https://registry.npmjs.org/dompurify/-/dompurify-2.3.6.tgz#2e019d7d7617aacac07cbbe3d88ae3ad354cf875" + integrity sha512-OFP2u/3T1R5CEgWCEONuJ1a5+MFKnOYpkywpUSxv/dj1LeBT1erK+JwM7zK0ROy2BRhqVCf0LRw/kHqKuMkVGg== + domutils@^1.5.1, domutils@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" @@ -15101,6 +15106,13 @@ vue-docgen-loader@^1.5.0: loader-utils "^1.2.3" querystring "^0.2.0" +vue-dompurify-html@^2.5.1: + version "2.5.1" + resolved "https://registry.npmjs.org/vue-dompurify-html/-/vue-dompurify-html-2.5.1.tgz#a754f4ac7b18eb8fe41f461cb2bb1c4956a9bd2d" + integrity sha512-B8rQj2jAPJJhtKHHa6jg5B3/RoKBmmUl/awP/GxWXGu75j4Y7+MHqv0DG52v0Uz0taEpHyZun34KEYMAfrPWnA== + dependencies: + dompurify "^2.3.4" + vue-easytable@2.5.5: version "2.5.5" resolved "https://registry.yarnpkg.com/vue-easytable/-/vue-easytable-2.5.5.tgz#0d0ac244beb853859c76191c117311b5cf9654b5"