Build-server code execution via JavaScript frontmatter
Published Jun 10, 2022 · Updated Sep 17, 2024
JavaScript injection in Gatsby gatsby-plugin-mdx before 2.14.1 and 3.0.0 through 3.15.1 allows remote authenticated users to execute code. The plugin passes MDX frontmatter to gray-matter with its JavaScript engine enabled by default, so JavaScript blocks are evaluated on the build server. Exploitation requires untrusted or unsanitized MDX to enter webpack or GraphQL processing, and injected code runs with the build process's privileges.
Summary
What happened
JavaScript injection in Gatsby gatsby-plugin-mdx before 2.14.1 and 3.0.0 through 3.15.1 allows remote authenticated users to execute code. The plugin passes MDX frontmatter to gray-matter with its JavaScript engine enabled by default, so JavaScript blocks are evaluated on the build server. Exploitation requires untrusted or unsanitized MDX to enter webpack or GraphQL processing, and injected code runs with the build process's privileges.
The record
- CVE
- CVE-2022-25863
- Published
- Jun 10, 2022
- Updated
- Sep 17, 2024
- Vendor
- Gatsby
- Product
- gatsby-plugin-mdx
- Classifications
- CWE-502, T1059.007
- Attack vector
- network
- Privileges
- authenticated
Timeline
How it unfolded
- Jun 10, 2022CVE publishedPublication date reported by the CVE source.
- Sep 17, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=3.0.0 <unspecified
- Affected versionversion=unspecified <2.14.1
- Affected versionversion=unspecified <3.15.2
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Public exploit references
- gatsby-plugin-mdx JavaScript frontmatter proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo