Skip to content

Commit

Permalink
[ui-cve]Upgrade sanitize-html to fix CVE-2024-21501 (#3769)
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhibhatg authored Jun 28, 2024
1 parent 4cb7a52 commit db70a86
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 42 deletions.
4 changes: 4 additions & 0 deletions desktop/core/src/desktop/js/utils/html/deXSS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const deXSS = (str?: undefined | boolean | string | number | null, options?: IOp
if (str === null) {
return 'null';
}
//Fix for sanitize HTML returns empty string for boolean false values.
if (typeof str === 'boolean') {
return str.toString();
}
if (typeof str !== 'undefined') {
return sanitizeHtml(str as string, options) || '';
}
Expand Down
112 changes: 72 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"react-joyride": "2.7.0",
"regenerator-runtime": "0.13.7",
"removeNPMAbsolutePaths": "1.0.6",
"sanitize-html": "2.7.2",
"sanitize-html": "2.13.0",
"select2": "4.0.13",
"selectize-plugin-clear": "0.0.3",
"sprintf-js": "1.1.2",
Expand Down Expand Up @@ -141,7 +141,7 @@
"sass": "1.34.0",
"sass-loader": "11.1.1",
"snarkdown": "2.0.0",
"source-map-loader": "3.0.0",
"source-map-loader": "5.0.0",
"style-loader": "2.0.0",
"styled-components": "6.0.8",
"stylelint": "14.3.0",
Expand Down

0 comments on commit db70a86

Please sign in to comment.