CVE-2022-25863
CRITICAL 9.8CVSS 3.1Unsanitized JavaScript code injection possible in gatsby-plugin-mdx
The package gatsby-plugin-mdx before 2.14.1, from 3.0.0 and before 3.15.2 are vulnerable to Deserialization of Untrusted Data when passing input through to the gray-matter package, due to its default configurations that are missing input sanitization. Exploiting this vulnerability is possible when passing input in both webpack (MDX files in src/pages or MDX file imported as a component in frontend / React code) and data mode (querying MDX nodes via GraphQL). Workaround: If an older version of gatsby-plugin-mdx must be used, input passed into the plugin should be sanitized ahead of processing.
- Published
- 10 Jun 2022
- Last modified
- 29 Sep 2026
- Assigned by
- report@snyk.io
- NVD status
- Analyzed
- Weakness
- CWE-502
- Also known as
- GHSA-mj46-r4gr-5x83SNYK-JS-GATSBYPLUGINMDX-2405699
- Sources
- NVDJSONOSV GHSA-mj46-r4gr-5x83JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | report@snyk.io (Secondary) | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N |
| OSV | GitHub | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | HIGH 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | gatsbyjs | gatsby-plugin-mdxcpe:2.3:a:gatsbyjs:gatsby-plugin-mdx:*:*:*:*:*:node.js:*:* |
< 2.14.1 | 2.14.1 |
| NVD | gatsbyjs | gatsby-plugin-mdxcpe:2.3:a:gatsbyjs:gatsby-plugin-mdx:*:*:*:*:*:node.js:*:* |
>= 3.0.0, < 3.15.2 | 3.15.2 |
| OSV | npm | gatsby-plugin-mdx | < 2.14.1 | 2.14.1 |
| OSV | npm | gatsby-plugin-mdx | >= 3.0.0, < 3.15.2 | 3.15.2 |
References
- https://drive.google.com/file/d/1EoCzbwTWOM8-fjvwMbH3bqcZ2iKksxTW/view?usp=sharing · Exploit, Third Party Advisory, WEB
- https://github.com/gatsbyjs/gatsby/pull/35830 · Exploit, Patch, Third Party Advisory, WEB
- https://github.com/gatsbyjs/gatsby/pull/35830/commits/f214eb0694c61e348b2751cecd1aace2046bc46e · Patch, Third Party Advisory, WEB
- https://snyk.io/vuln/SNYK-JS-GATSBYPLUGINMDX-2405699 · Exploit, Third Party Advisory, WEB
- https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-mj46-r4gr-5x83 · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-25863 · ADVISORY
- https://github.com/gatsbyjs/gatsby · PACKAGE
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 10 Jun 2022)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 3 Jun 2022)