CVE-2022-25863Gatsbyjs Gatsby-plugin-mdx
Critical 9.8 No auth needed
Follow: this CVE · Gatsbyjs · Gatsbyjs Gatsby-plugin-mdx We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- 1.9% probability of exploitation in 30 days · percentile 80
- Auth required
- No
- Published
- Jun 10, 2022
- Updated
- Sep 29, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-502
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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.
What to do
- Apply the vendor's security update for Gatsby-plugin-mdx.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | gatsby-plugin-mdx |
< 2.14.1 |
2.14.1 |
npm install gatsby-plugin-mdx@2.14.1 |
| npm | gatsby-plugin-mdx |
≥ 3.0.0 < 3.15.2 |
3.15.2 |
npm install gatsby-plugin-mdx@3.15.2 |
Per OSV / GitHub Advisories (GHSA-mj46-r4gr-5x83). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| gatsbyjs | gatsby-plugin-mdx | < 2.14.1 |
| gatsbyjs | gatsby-plugin-mdx | ≥ 3.0.0 < 3.15.2 |
Official sources
References
Links published by the sources. Open them with care.
- drive.google.com Exploit Third Party Advisory
- github.com Exploit Patch Third Party Advisory
- github.com Patch Third Party Advisory
- snyk.io Exploit Third Party Advisory