Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency gatsby-plugin-mdx to v2.14.1 [SECURITY] #376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jun 18, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
gatsby-plugin-mdx (source) 2.8.0 -> 2.14.1 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2022-25863

Impact

The gatsby-plugin-mdx plugin prior to versions 3.15.2 and 2.14.1 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 when passing input in both webpack (MDX files in src/pages or MDX file imported as component in frontend / React code) and data mode (querying MDX 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 or added into an MDX file. The following MDX payload demonstrates a vulnerable configuration:

---js
((require("child_process")).execSync("id >> /tmp/rce"))
--- 

Patches

A patch has been introduced in gatsby-plugin-mdx@3.15.2 and gatsby-plugin-mdx@2.14.1 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 MDX input is attempting to use the Frontmatter engine.

Workarounds

If an older version of gatsby-plugin-mdx must be used, input passed into the plugin should be sanitized ahead of processing.

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.

Credits

We would like to thank Snyk [snyk.io] for initially bringing the issue to our attention, as well as Feng Xiao and Zhongfu Su, who reported the issue to Snyk.

For more information

Email us at security@gatsbyjs.com.


Release Notes

gatsbyjs/gatsby (gatsby-plugin-mdx)

v2.14.1

Compare Source

v2.14.0

Compare Source

🧾 Release notes

Bug Fixes
Chores

v2.13.0

Compare Source

🧾 Release notes

Chores

v2.12.0

Compare Source

🧾 Release notes

Chores

v2.11.0

Compare Source

🧾 Release notes

Bug Fixes
2.10.1 (2021-07-26)
Bug Fixes

v2.10.1

Compare Source

Bug Fixes

v2.10.0

Compare Source

🧾 Release notes

Chores

v2.9.0

Compare Source

🧾 Release notes

Features
Chores

Configuration

πŸ“… Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

β™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

πŸ”• Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot changed the title Update dependency gatsby-plugin-mdx to v2.14.1 [SECURITY] Update dependency gatsby-plugin-mdx to v2.14.1 [SECURITY] - autoclosed Feb 24, 2024
@renovate renovate bot closed this Feb 24, 2024
@renovate renovate bot deleted the renovate/npm-gatsby-plugin-mdx-vulnerability branch February 24, 2024 07:40
@renovate renovate bot changed the title Update dependency gatsby-plugin-mdx to v2.14.1 [SECURITY] - autoclosed Update dependency gatsby-plugin-mdx to v2.14.1 [SECURITY] Feb 24, 2024
@renovate renovate bot reopened this Feb 24, 2024
@renovate renovate bot restored the renovate/npm-gatsby-plugin-mdx-vulnerability branch February 24, 2024 09:47
@renovate renovate bot force-pushed the renovate/npm-gatsby-plugin-mdx-vulnerability branch from 8913507 to 3fc52c8 Compare February 24, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants