{"id":"CVE-2023-22491","revision":null,"records":[{"revision":"52d803e4c8064b0b8bea0c72e2d82f16","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2023-22491","aliases":[],"title":"gatsby-transformer-remark vulnerable to unsanitized JavaScript code injection ","description":"Gatsby is a free and open source framework based on React that helps developers build websites and apps. The gatsby-transformer-remark plugin prior to versions 5.25.1 and 6.3.2 passes input through to the `gray-matter` npm package, which is vulnerable to JavaScript injection in its default configuration, unless input is sanitized.  The vulnerability is present in gatsby-transformer-remark when passing input in data mode (querying MarkdownRemark nodes via GraphQL).  Injected JavaScript executes in the context of the build server. To exploit this vulnerability untrusted/unsanitized input would need to be sourced by or added into a file processed by gatsby-transformer-remark. A patch has been introduced in `gatsby-transformer-remark@5.25.1` and `gatsby-transformer-remark@6.3.2` which mitigates the issue by disabling the `gray-matter` JavaScript Frontmatter engine. As a workaround, if an older version of `gatsby-transformer-remark` must be used, input passed into the plugin should be sanitized ahead of processing. It is encouraged for  projects to upgrade to the latest major release branch for all Gatsby plugins to ensure the latest security updates and bug fixes are received in a timely manner.","state":0,"publishedAt":"2023-01-13T18:05:00.273+00:00","modifiedAt":"2025-03-11T13:34:01.261+00:00","affected":[{"ecosystem":"Vendor product","name":"gatsby","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"gatsbyjs\",\n                    \"product\": \"gatsby\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 6.0.0, < 6.3.2\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"< 5.25.1\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":8.1,"severity":"HIGH"}],"references":["https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2023-22491","license":"CVE Program Terms of Use","key":"cve-program:CVE-2023-22491","identifiers":["CVE-2023-22491"]},"retained":false,"historicalAffected":[]},{"revision":"de9a1bd751bc4a63bd7ced003c658917","observedAt":"2026-11-12T03:05:21.824+00:00","statement":{"source":"euvd","id":"EUVD-2023-0381","aliases":["CVE-2023-22491","GHSA-7ch4-rr99-cqcw"],"title":"Gatsby is a free and open source framework based on React that helps developers build websites and apps. The gatsby-transformer-remark plugin prior to versions 5.25.1 and 6.3.2 passes input through to the `gray-matter` npm package, which is…","description":"Gatsby is a free and open source framework based on React that helps developers build websites and apps. The gatsby-transformer-remark plugin prior to versions 5.25.1 and 6.3.2 passes input through to the `gray-matter` npm package, which is vulnerable to JavaScript injection in its default configuration, unless input is sanitized.  The vulnerability is present in gatsby-transformer-remark when passing input in data mode (querying MarkdownRemark nodes via GraphQL).  Injected JavaScript executes in the context of the build server. To exploit this vulnerability untrusted/unsanitized input would need to be sourced by or added into a file processed by gatsby-transformer-remark. A patch has been introduced in `gatsby-transformer-remark@5.25.1` and `gatsby-transformer-remark@6.3.2` which mitigates the issue by disabling the `gray-matter` JavaScript Frontmatter engine. As a workaround, if an older version of `gatsby-transformer-remark` must be used, input passed into the plugin should be sanitized ahead of processing. It is encouraged for  projects to upgrade to the latest major release branch for all Gatsby plugins to ensure the latest security updates and bug fixes are received in a timely manner.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":8.1,"severity":null}],"references":["https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2023-0381","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Jan 13, 2023, 6:05:00 PM","dateUpdated":"Mar 11, 2025, 1:34:01 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2023-0381","identifiers":["EUVD-2023-0381","CVE-2023-22491","GHSA-7ch4-rr99-cqcw"]},"retained":false,"historicalAffected":[]},{"revision":"3e7b3a4bfda24357801a1f3e70b590cd","observedAt":"2026-10-24T21:17:28.488+00:00","statement":{"source":"nvd","id":"CVE-2023-22491","aliases":[],"title":"Gatsby is a free and open source framework based on React that helps developers build websites and apps. The gatsby-transformer-remark plugin prior to versions 5.25.1 and 6.3.2 passes input through to the `gray-matter` npm package, which is…","description":"Gatsby is a free and open source framework based on React that helps developers build websites and apps. The gatsby-transformer-remark plugin prior to versions 5.25.1 and 6.3.2 passes input through to the `gray-matter` npm package, which is vulnerable to JavaScript injection in its default configuration, unless input is sanitized.  The vulnerability is present in gatsby-transformer-remark when passing input in data mode (querying MarkdownRemark nodes via GraphQL).  Injected JavaScript executes in the context of the build server. To exploit this vulnerability untrusted/unsanitized input would need to be sourced by or added into a file processed by gatsby-transformer-remark. A patch has been introduced in `gatsby-transformer-remark@5.25.1` and `gatsby-transformer-remark@6.3.2` which mitigates the issue by disabling the `gray-matter` JavaScript Frontmatter engine. As a workaround, if an older version of `gatsby-transformer-remark` must be used, input passed into the plugin should be sanitized ahead of processing. It is encouraged for  projects to upgrade to the latest major release branch for all Gatsby plugins to ensure the latest security updates and bug fixes are received in a timely manner.","state":0,"publishedAt":"2023-01-13T19:15:12.407+00:00","modifiedAt":"2026-09-29T15:06:00.643+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":8.1,"severity":"HIGH"},{"system":"CVSS 3.1 · nvd@nist.gov · Primary","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"severity":"MEDIUM"}],"references":["https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2023-22491","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-20","CWE-89","CWE-79"],"productCriteria":["cpe:2.3:a:gatsbyjs:gatsby-transformer-remark:*:*:*:*:*:node.js:*:*"],"sourceDates":{"published":"2023-01-13T19:15:12.407","lastModified":"2026-09-29T15:06:00.643"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2023-22491","identifiers":["CVE-2023-22491"]},"retained":false,"historicalAffected":[]},{"revision":"924c756398e14d0a8738d6d74f4b2029","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-7ch4-rr99-cqcw","aliases":["CVE-2023-22491"],"title":"gatsby-transformer-remark has possible unsanitized JavaScript code injection","description":"### Impact\nThe gatsby-transformer-remark plugin prior to versions 5.25.1 and 6.3.2 passes input through to the `gray-matter` npm package, which is vulnerable to JavaScript injection in its default configuration, unless input is sanitized.  The vulnerability is present in gatsby-transformer-remark when passing input in data mode (querying MarkdownRemark nodes via GraphQL).  Injected JavaScript executes in the context of the build server.\n\nTo exploit this vulnerability untrusted/unsanitized input would need to be sourced by or added into a file processed by gatsby-transformer-remark.  The following payload demonstrates a vulnerable configuration:\n```\n---js\n((require(\"child_process\")).execSync(\"id >> /tmp/rce\"))\n--- \n```\n\n### Patches\nA patch has been introduced in `gatsby-transformer-remark@5.25.1` and `gatsby-transformer-remark@6.3.2` which mitigates the issue by disabling the `gray-matter` JavaScript Frontmatter engine.  The patch introduces a new option, `JSFrontmatterEngine` which is set to `false` by default.  When setting `JSFrontmatterEngine` to `true`, input passed to `gatsby-plugin-mdx` must be sanitized before processing to avoid a security risk.  Warnings are displayed when enabling `JSFrontmatterEngine` to `true` or if it appears that the MarkdownRemark input is attempting to use the Frontmatter engine.\n\n### Workarounds\nIf an older version of `gatsby-transformer-remark` must be used, input passed into the plugin should be sanitized ahead of processing.\n\n**We encourage projects to upgrade to the latest major release branch for all Gatsby plugins to ensure the latest security updates and bug fixes are received in a timely manner.**\n\n\n### For more information\nEmail us at [security@gatsbyjs.com](mailto:security@gatsbyjs.com).","state":0,"publishedAt":"2023-01-11T18:27:15+00:00","modifiedAt":"2026-09-10T03:49:51.0232905+00:00","affected":[{"ecosystem":"npm","name":"gatsby-transformer-remark","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"6.0.0"},{"kind":"fixed","version":"6.3.2"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"gatsby-transformer-remark","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"5.25.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-7ch4-rr99-cqcw","https://nvd.nist.gov/vuln/detail/CVE-2023-22491","https://github.com/gatsbyjs/gatsby"],"sourceUrl":"https://github.com/advisories/GHSA-7ch4-rr99-cqcw","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-7ch4-rr99-cqcw","identifiers":["GHSA-7ch4-rr99-cqcw","CVE-2023-22491"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-12T06:54:08.8081877+00:00","complete":true,"records":1779,"lastAttemptAt":"2026-11-12T06:54:08.8081877+00:00","lastSuccessAt":"2026-11-12T06:54:09.4926633+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:54:09.4926642+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-64752486c567b55b31fb0d7225f5222bcd0019564ac0ac5f0649e242c7b19299-031557bd84075d0efeb8f81d38e7e201c5767c1ec5ad4deb9375464dfdb790d3","complete":true,"records":424595,"lastAttemptAt":"2026-11-12T06:53:59.6712569+00:00","lastSuccessAt":"2026-11-12T06:53:59.6124706+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:53:59.6712569+00:00","snapshotPublishedAt":"2026-11-12T06:27:50+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-570328139368428ca550af1570d01579","complete":true,"records":13760,"lastAttemptAt":"2026-11-12T06:55:06.9273282+00:00","lastSuccessAt":"2026-11-12T06:55:06.923+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:55:06.923+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13813,"expectedIdentifiers":13813,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-12T06:54:08.8081877+00:00","complete":true,"records":1097,"lastAttemptAt":"2026-11-12T06:54:08.8081877+00:00","lastSuccessAt":"2026-11-12T06:54:09.7509822+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:54:09.7509833+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-5bd6a0be90c14da3820334c987af617f","complete":true,"records":13760,"lastAttemptAt":"2026-11-12T06:54:37.2126404+00:00","lastSuccessAt":"2026-11-12T06:54:37.209+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:54:37.209+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13813,"expectedIdentifiers":13813,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-3562b6c78fd1bd0f0b55daf66a0926ae24f65e462df7f6d928caad458fc696bf","complete":true,"records":9947,"lastAttemptAt":"2026-11-12T06:54:07.7500838+00:00","lastSuccessAt":"2026-11-11T04:27:43.6877707+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:54:07.7500838+00:00","snapshotPublishedAt":"2026-11-11T03:32:46+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-456002455e0ab94bb92c95476d4e6d175c104cd594749982afd96c893728ecbc","complete":true,"records":2010,"lastAttemptAt":"2026-11-12T06:54:05.0323741+00:00","lastSuccessAt":"2026-11-11T02:36:58.1276999+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:54:05.0323741+00:00","snapshotPublishedAt":"2026-11-11T01:17:51+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-baa8362b4daf9e5f39d5563775a55935e7b442c0735d33274a921579ce4a0d66","complete":true,"records":3093,"lastAttemptAt":"2026-11-12T06:54:08.5688182+00:00","lastSuccessAt":"2026-11-11T13:00:02.5446881+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:54:08.5688182+00:00","snapshotPublishedAt":"2026-11-11T12:47:47+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-eb5176d73e87a862c4cae7484f3fd31f7d170139114b3e99e25926d661f6435b","complete":true,"records":231700,"lastAttemptAt":"2026-11-12T06:54:05.6319464+00:00","lastSuccessAt":"2026-11-12T05:58:39.2691741+00:00","error":null,"lastVerifiedAt":"2026-11-12T06:54:05.6319464+00:00","snapshotPublishedAt":"2026-11-12T05:48:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}