Skip to content

Commit

Permalink
security: v2 CVE-2024-22191 (#2382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob committed Jan 18, 2024
1 parent 51692a8 commit fc92a05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/javascript/js/controllers/fields/key_value_controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable max-len */
import * as DOMPurify from 'dompurify'
import { Controller } from '@hotwired/stimulus'
import { castBoolean } from '../../helpers/cast_boolean'

Expand Down Expand Up @@ -80,7 +81,7 @@ export default class extends Controller {
let index = 0
this.fieldValue.forEach((row) => {
const [key, value] = row
result += this.interpolatedRow(key, value, index)
result += this.interpolatedRow(DOMPurify.sanitize(key), DOMPurify.sanitize(value), index)
index++
})
this.rowsTarget.innerHTML = result
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"codemirror": "5.59.1",
"core-js": "^3.21.0",
"css-loader": "^6.7.0",
"dompurify": "^3.0.8",
"easymde": "^2.18.0",
"el-transition": "^0.0.7",
"esbuild": "^0.14.25",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,11 @@ doctrine@^3.0.0:
dependencies:
esutils "^2.0.2"

dompurify@^3.0.8:
version "3.0.8"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.8.tgz#e0021ab1b09184bc8af7e35c7dd9063f43a8a437"
integrity sha512-b7uwreMYL2eZhrSCRC4ahLTeZcPZxSmYfmcQGXGkXiZSNW1X85v+SDM5KsWcpivIiUBH47Ji7NtyUdpLeF5JZQ==

easymde@^2.18.0:
version "2.18.0"
resolved "https://registry.yarnpkg.com/easymde/-/easymde-2.18.0.tgz#ff1397d07329b1a7b9187d2d0c20766fa16b3b1b"
Expand Down

0 comments on commit fc92a05

Please sign in to comment.