From 6fbc94cd7e10e78fd446a162242beff0e408cfd0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:40:22 +0000 Subject: [PATCH 1/3] [frontend] Update dependency dompurify to v3.2.3 --- openbas-front/package.json | 2 +- openbas-front/yarn.lock | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/openbas-front/package.json b/openbas-front/package.json index b71cf564ac..1a2c6aa11f 100644 --- a/openbas-front/package.json +++ b/openbas-front/package.json @@ -32,7 +32,7 @@ "cronstrue": "2.51.0", "d3-hierarchy": "3.1.2", "date-fns": "4.1.0", - "dompurify": "3.1.6", + "dompurify": "3.2.3", "elkjs": "0.9.3", "final-form": "4.20.10", "final-form-arrays": "3.1.0", diff --git a/openbas-front/yarn.lock b/openbas-front/yarn.lock index c93ab129e6..dd7466c8dd 100644 --- a/openbas-front/yarn.lock +++ b/openbas-front/yarn.lock @@ -3182,6 +3182,13 @@ __metadata: languageName: node linkType: hard +"@types/trusted-types@npm:^2.0.7": + version: 2.0.7 + resolution: "@types/trusted-types@npm:2.0.7" + checksum: 10c0/4c4855f10de7c6c135e0d32ce462419d8abbbc33713b31d294596c0cc34ae1fa6112a2f9da729c8f7a20707782b0d69da3b1f8df6645b0366d08825ca1522e0c + languageName: node + linkType: hard + "@types/unist@npm:*, @types/unist@npm:^3.0.0": version: 3.0.3 resolution: "@types/unist@npm:3.0.3" @@ -4989,10 +4996,15 @@ __metadata: languageName: node linkType: hard -"dompurify@npm:3.1.6": - version: 3.1.6 - resolution: "dompurify@npm:3.1.6" - checksum: 10c0/3de1cca187c78d3d8cb4134fc2985b644d6a81f6b4e024c77cfb04c1c2f38544ccf7b0ea37a48ce22fcca64594170ed7c22252574c75b801c44345cdd7b06c64 +"dompurify@npm:3.2.3": + version: 3.2.3 + resolution: "dompurify@npm:3.2.3" + dependencies: + "@types/trusted-types": "npm:^2.0.7" + dependenciesMeta: + "@types/trusted-types": + optional: true + checksum: 10c0/0ce5cb89b76f396d800751bcb48e0d137792891d350ccc049f1bc9a5eca7332cc69030c25007ff4962e0824a5696904d4d74264df9277b5ad955642dfb6f313f languageName: node linkType: hard @@ -8954,7 +8966,7 @@ __metadata: cross-env: "npm:7.0.3" d3-hierarchy: "npm:3.1.2" date-fns: "npm:4.1.0" - dompurify: "npm:3.1.6" + dompurify: "npm:3.2.3" elkjs: "npm:0.9.3" esbuild: "npm:0.24.0" eslint: "npm:9.15.0" From 85d5ad4f04f72e1cd63e682443df372152f854e6 Mon Sep 17 00:00:00 2001 From: Romuald Lemesle Date: Thu, 19 Dec 2024 14:41:53 +0100 Subject: [PATCH 2/3] [frontend] Ignore dompurify export --- openbas-front/eslint.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/openbas-front/eslint.config.js b/openbas-front/eslint.config.js index ebd8db5abc..2dee5f31a2 100644 --- a/openbas-front/eslint.config.js +++ b/openbas-front/eslint.config.js @@ -42,6 +42,7 @@ export default [ 'import/resolver': 'oxc', 'import/ignore': [ 'react-apexcharts', // ignore react-apexcharts as the default export is broken + 'dompurify', ], }, }, From ab24c680909b31950cdffca769ae5a456971f308 Mon Sep 17 00:00:00 2001 From: Guillaume Paris Date: Fri, 20 Dec 2024 14:22:27 +0100 Subject: [PATCH 3/3] [frontend] fix dompurify import --- openbas-front/eslint.config.js | 1 - .../simulations/simulation/mails/Communication.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openbas-front/eslint.config.js b/openbas-front/eslint.config.js index 2dee5f31a2..ebd8db5abc 100644 --- a/openbas-front/eslint.config.js +++ b/openbas-front/eslint.config.js @@ -42,7 +42,6 @@ export default [ 'import/resolver': 'oxc', 'import/ignore': [ 'react-apexcharts', // ignore react-apexcharts as the default export is broken - 'dompurify', ], }, }, diff --git a/openbas-front/src/admin/components/simulations/simulation/mails/Communication.js b/openbas-front/src/admin/components/simulations/simulation/mails/Communication.js index 44356cb3a5..45edfc6786 100644 --- a/openbas-front/src/admin/components/simulations/simulation/mails/Communication.js +++ b/openbas-front/src/admin/components/simulations/simulation/mails/Communication.js @@ -2,7 +2,7 @@ import { AttachFileRounded, ExpandLess, ExpandMore } from '@mui/icons-material'; import { Avatar, Button, Card, CardContent, CardHeader, IconButton } from '@mui/material'; import { lightBlue } from '@mui/material/colors'; import { makeStyles, useTheme } from '@mui/styles'; -import DOMPurify from 'dompurify'; +import purify from 'dompurify'; import parse from 'html-react-parser'; import { useState } from 'react'; @@ -134,8 +134,8 @@ const Communication = (props) => { {isHtml ? (
{expand - ? parse(DOMPurify.sanitize(content)) - : parse(DOMPurify.sanitize(truncate(content, limit)))} + ? parse(purify.sanitize(content)) + : parse(purify.sanitize(truncate(content, limit)))}
) : (