CVE-2022-25863: Unsanitized JavaScript code injection possible in gatsby-plugin-mdx
8.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.70545%
CWE
Published
6/3/2022
Updated
1/27/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| gatsby-plugin-mdx | npm | < 2.14.1 | 2.14.1 |
| gatsby-plugin-mdx | npm | >= 3.0.0, < 3.15.2 | 3.15.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from gatsby-plugin-mdx passing MDX content to gray-matter without disabling its JavaScript frontmatter engine. The core issue manifests in all MDX processing paths (webpack loader, GraphQL node creation) where gray-matter was invoked with default options. The patched versions explicitly set JSFrontmatterEngine: false and remove JS engine support, confirming these grayMatter call sites were the vulnerable points. The test cases in the commit diff validate() that JS frontmatter processing was previously enabled in these functions.