Skip to content

Security: prismjs is vulnerable to CVE-2024-53382 #10382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
marvingreeven opened this issue Mar 24, 2025 · 4 comments
Open

Security: prismjs is vulnerable to CVE-2024-53382 #10382

marvingreeven opened this issue Mar 24, 2025 · 4 comments

Comments

@marvingreeven
Copy link

Q&A (please complete the following information)

  • Swagger-UI version: 5.20.1

Content & configuration

npm audit --omit=dev --json --registry=https://registry.npmjs.org

Describe the bug you're encountering

swagger-ui refers to "react-syntax-highlighter" : "^15.6.1" which refers to "refractor": "^3.6.0" which refers to "prismjs": "~1.27.0".

It seems like the project react-syntax-highlighter is not maintained that well.

Additional context or thoughts

"auditReportVersion": 2,
  "vulnerabilities": {
    "prismjs": {
      "name": "prismjs",
      "severity": "moderate",
      "isDirect": false,
      "via": [
        {
          "source": 1102459,
          "name": "prismjs",
          "dependency": "prismjs",
          "title": "PrismJS DOM Clobbering vulnerability",
          "url": "https://github.com/advisories/GHSA-x7hr-w5r2-h6wg",
          "severity": "moderate",
          "cwe": [
            "CWE-94"
          ],
          "cvss": {
            "score": 4.9,
            "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N"
          },
        }
      ],
      "effects": [
        "refractor"
      ],
      "range": "<1.30.0",
      "nodes": [
        "node_modules/refractor/node_modules/prismjs"
      ],
      "fixAvailable": {
        "name": "swagger-ui",
        "version": "3.29.0",
        "isSemVerMajor": true
      }
    },
    "react-syntax-highlighter": {
      "name": "react-syntax-highlighter",
      "severity": "moderate",
      "isDirect": false,
      "via": [
        "refractor"
      ],
      "effects": [
        "swagger-ui"
      ],
      "range": ">=6.0.0",
      "nodes": [
        "node_modules/react-syntax-highlighter"
      ],
      "fixAvailable": {
        "name": "swagger-ui",
        "version": "3.29.0",
        "isSemVerMajor": true
      }
    },
    "refractor": {
      "name": "refractor",
      "severity": "moderate",
      "isDirect": false,
      "via": [
        "prismjs"
      ],
      "effects": [
        "react-syntax-highlighter"
      ],
      "range": "<=4.6.0",
      "nodes": [
        "node_modules/refractor"
      ],
      "fixAvailable": {
        "name": "swagger-ui",
        "version": "3.29.0",
        "isSemVerMajor": true
      }
    },
    "swagger-ui": {
      "name": "swagger-ui",
      "severity": "moderate",
      "isDirect": true,
      "via": [
        "react-syntax-highlighter"
      ],
      "effects": [],
      "range": ">=3.30.0",
      "nodes": [
        "node_modules/swagger-ui"
      ],
      "fixAvailable": {
        "name": "swagger-ui",
        "version": "3.29.0",
        "isSemVerMajor": true
      }
    }
  },
@ishworg
Copy link

ishworg commented Mar 27, 2025

Can we get a fix in please? Thanks!

@machma02
Copy link

machma02 commented Apr 4, 2025

Still affecting v5.20.5

@skubot
Copy link

skubot commented Apr 6, 2025

This is a downstream issue with react-syntax-highlighter@latest, which is using an outdated [email protected]

Adding this to package.json should work in the meantime...

"resolutions": {
  "prismjs": "1.30.0"
},

@akbast
Copy link

akbast commented Apr 25, 2025

It is still to see in v5.21.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants