@gitlab/duo-ui 10.6.0 → 10.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [10.6.1](https://gitlab.com/gitlab-org/duo-ui/compare/v10.6.0...v10.6.1) (2025-07-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * enhance markdown renderer security ([b73cc42](https://gitlab.com/gitlab-org/duo-ui/commit/b73cc42ecbec353cbe3646ceb0dacfd506b08975))
7
+ * enhance markdown renderer security ([c422395](https://gitlab.com/gitlab-org/duo-ui/commit/c422395af70992d91d1bc0350d87d1bbba9cfa9b))
8
+
1
9
  # [10.6.0](https://gitlab.com/gitlab-org/duo-ui/compare/v10.5.0...v10.6.0) (2025-07-09)
2
10
 
3
11
 
@@ -11,7 +11,7 @@ const duoMarked = new Marked([{
11
11
  const config = {
12
12
  ADD_TAGS: ['insert-code-snippet', 'copy-code', 'gl-markdown', '#text', 'gl-compact-markdown'],
13
13
  ADD_ATTR: ['data-canonical-lang', 'data-sourcepos', 'lang', 'data-src', 'img'],
14
- FORBID_TAGS: ['script', 'style', 'iframe', 'form', 'button'],
14
+ FORBID_TAGS: ['script', 'style', 'iframe', 'form', 'button', 'svg', 'video', 'audio', 'embed', 'object'],
15
15
  FORBID_ATTR: ['onerror', 'onload', 'onclick']
16
16
  };
17
17
  const handleImageElements = node => {
@@ -29,8 +29,8 @@ const handleImageElements = node => {
29
29
  * @returns {boolean} - True if the URL is a safe relative URL
30
30
  */
31
31
  function isRelativeUrlWithoutEmbeddedUrls(url) {
32
- // Check if the string starts with a slash
33
- if (!url.startsWith('/')) {
32
+ // Check if the string starts with a slash but not with double slash (protocol-relative URLs)
33
+ if (!url.startsWith('/') || url.startsWith('//')) {
34
34
  return false;
35
35
  }
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/duo-ui",
3
- "version": "10.6.0",
3
+ "version": "10.6.1",
4
4
  "description": "Duo UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -97,10 +97,10 @@
97
97
  "@babel/plugin-proposal-optional-chaining": "^7.21.0",
98
98
  "@babel/preset-env": "^7.28.0",
99
99
  "@babel/preset-react": "^7.27.1",
100
- "@gitlab/eslint-plugin": "21.1.0",
100
+ "@gitlab/eslint-plugin": "21.2.0",
101
101
  "@gitlab/fonts": "^1.3.0",
102
102
  "@gitlab/stylelint-config": "6.2.2",
103
- "@gitlab/svgs": "^3.137.0",
103
+ "@gitlab/svgs": "^3.139.0",
104
104
  "@gitlab/ui": "latest",
105
105
  "@jest/test-sequencer": "^29.7.0",
106
106
  "@rollup/plugin-commonjs": "^11.1.0",
@@ -155,8 +155,8 @@
155
155
  "module-alias": "^2.2.2",
156
156
  "npm-run-all": "^4.1.5",
157
157
  "pikaday": "^1.8.0",
158
- "playwright": "^1.53.2",
159
- "playwright-core": "^1.53.2",
158
+ "playwright": "^1.54.0",
159
+ "playwright-core": "^1.54.0",
160
160
  "plop": "^2.5.4",
161
161
  "postcss": "8.4.28",
162
162
  "postcss-loader": "^7.0.2",
@@ -15,7 +15,18 @@ const duoMarked = new Marked([
15
15
  const config = {
16
16
  ADD_TAGS: ['insert-code-snippet', 'copy-code', 'gl-markdown', '#text', 'gl-compact-markdown'],
17
17
  ADD_ATTR: ['data-canonical-lang', 'data-sourcepos', 'lang', 'data-src', 'img'],
18
- FORBID_TAGS: ['script', 'style', 'iframe', 'form', 'button'],
18
+ FORBID_TAGS: [
19
+ 'script',
20
+ 'style',
21
+ 'iframe',
22
+ 'form',
23
+ 'button',
24
+ 'svg',
25
+ 'video',
26
+ 'audio',
27
+ 'embed',
28
+ 'object',
29
+ ],
19
30
  FORBID_ATTR: ['onerror', 'onload', 'onclick'],
20
31
  };
21
32
 
@@ -34,8 +45,8 @@ const handleImageElements = (node) => {
34
45
  * @returns {boolean} - True if the URL is a safe relative URL
35
46
  */
36
47
  function isRelativeUrlWithoutEmbeddedUrls(url) {
37
- // Check if the string starts with a slash
38
- if (!url.startsWith('/')) {
48
+ // Check if the string starts with a slash but not with double slash (protocol-relative URLs)
49
+ if (!url.startsWith('/') || url.startsWith('//')) {
39
50
  return false;
40
51
  }
41
52