Miggo Logo

CVE-2023-22491: gatsby-transformer-remark has possible unsanitized JavaScript code injection

8.1

CVSS Score
3.1

Basic Information

EPSS Score
0.34309%
Published
1/11/2023
Updated
1/23/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
gatsby-transformer-remarknpm>= 6.0.0, < 6.3.26.3.2
gatsby-transformer-remarknpm< 5.25.15.25.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from gatsby-transformer-remark's integration with gray-matter's frontmatter parsing. Prior to patching, the plugin didn't disable gray-matter's JavaScript engine (enabled by default), allowing execution of untrusted JS in Markdown frontmatter. The patch explicitly disabled this engine via JSFrontmatterEngine: false. While no specific function names are provided in advisories, the core vulnerability exists in the gray-matter integration point where frontmatter parsing occurs without JS engine disabling.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t T** **ts*y-tr*ns*orm*r-r*m*rk plu*in prior to v*rsions *.**.* *n* *.*.* p*ss*s input t*rou** to t** `*r*y-m*tt*r` npm p**k***, w*i** is vuln*r**l* to J*v*S*ript inj**tion in its ****ult *on*i*ur*tion, unl*ss input is s*nitiz**. T** vuln*r

Reasoning

T** vuln*r**ility st*ms *rom `**ts*y-tr*ns*orm*r-r*m*rk`'s int**r*tion wit* `*r*y-m*tt*r`'s *rontm*tt*r p*rsin*. Prior to p*t**in*, t** plu*in *i*n't *is**l* `*r*y-m*tt*r`'s J*v*S*ript *n*in* (*n**l** *y ****ult), *llowin* *x**ution o* untrust** JS i