Skip to content

[Snyk] Security upgrade react-docgen from 5.4.3 to 6.0.0 #54

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

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

Conversation

paaschdigital
Copy link
Owner

snyk-top-banner

Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.

Snyk changed the following file(s):

  • @plotly/dash-test-components/package.json
  • @plotly/dash-test-components/package-lock.json

Vulnerabilities that will be fixed with an upgrade:

Issue Score
medium severity Regular Expression Denial of Service (ReDoS)
SNYK-JS-BABELRUNTIME-10044504
  738  

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Regular Expression Denial of Service (ReDoS)

…mponents/package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-BABELRUNTIME-10044504
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @paaschdigital, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request addresses a security vulnerability in the react-docgen dependency by upgrading it from version 5.4.3 to 6.0.0. The upgrade resolves a Regular Expression Denial of Service (ReDoS) vulnerability. The changes primarily involve updating the package-lock.json and package.json files within the @plotly/dash-test-components directory to reflect the new version of react-docgen and its related dependencies.

Highlights

  • Security Upgrade: Upgrades react-docgen from 5.4.3 to 6.0.0 to address a Regular Expression Denial of Service (ReDoS) vulnerability (SNYK-JS-BABELRUNTIME-10044504).
  • Dependency Updates: Updates dependencies in package-lock.json to align with the new react-docgen version, including @babel related packages.
  • Breaking Change: The upgrade to react-docgen 6.0.0 is considered a breaking change, potentially requiring adjustments in the codebase that relies on this dependency.

Changelog

Click here to see the changelog
  • @plotly/dash-test-components/package-lock.json
    • Updated react-docgen version from 5.4.3 to 6.0.0.
    • Updated @babel/helper-string-parser from 7.19.4 to 7.27.1.
    • Updated @babel/helper-validator-identifier from 7.19.1 to 7.27.1.
    • Updated @babel/parser from 7.19.6 to 7.27.2.
    • Added @types/babel__core, @types/babel__generator, @types/babel__template, @types/babel__traverse, and @types/doctrine.
    • Removed @bcoe/v8-coverage, @istanbuljs/schema, foreground-child, string-width, test-exclude, and v8-to-istanbul.
    • Marked several dependencies as dev: true, including balanced-match, brace-expansion, glob, fs.realpath, inherits, neo-async, nice-try, path-exists, path-is-absolute, regenerator-runtime, and yargs.
    • Updated function-bind from 1.1.1 to 1.1.2.
    • Removed ansi-regex, ast-types, html-escaper, rimraf, signal-exit, and tslib.
  • @plotly/dash-test-components/package.json
    • Upgraded react-docgen dependency from version 5.4.3 to 6.0.0.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A ReDoS threat,
A regex gone wrong, fret not,
Snyk's fix is here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request, automatically generated by Snyk, aims to upgrade react-docgen from version 5.4.3 to 6.0.0 to address a security vulnerability (ReDoS, SNYK-JS-BABELRUNTIME-10044504). While security upgrades are important, this is a major version bump for react-docgen, and Snyk's metadata indicates it's a breaking change. This requires careful attention to ensure the project's build process, which utilizes react-docgen via dash-generate-components, remains functional.

Summary of Findings

  • Potential Breaking Change Impact: The upgrade of react-docgen to v6.0.0 is a major version change and is flagged as a breaking change. It's crucial to verify that the dash-generate-components tool (from @plotly/dash-component-plugins) and the associated build scripts are compatible with this new version to prevent build failures.
  • Node.js Engine Requirement Update: [email protected] has updated its required Node.js version to >=14.18.0. The project's build and CI environments must meet this new requirement.
  • Dependency Type for react-docgen: react-docgen is listed as a production dependency but appears to be used primarily during build time by dash-generate-components (a development tool). Consider moving it to devDependencies for semantic correctness, especially since this package (dash-test-components) is private.

Merge Readiness

This pull request addresses an important security vulnerability. However, due to the upgrade of react-docgen to a new major version (v6.0.0) which is a breaking change, and the updated Node.js engine requirement, there are significant risks of build failures.

I recommend that the following points be thoroughly investigated and confirmed before merging:

  1. Compatibility of the dash-generate-components toolchain with [email protected].
  2. Ensuring the build and CI environments meet the new Node.js requirement of >=14.18.0.

Addressing these potential issues is crucial. As an AI assistant, I am not authorized to approve pull requests; this PR should be reviewed and approved by a human maintainer after these checks are completed. Given the critical and high severity concerns, changes or verifications are requested.

@@ -17,7 +17,7 @@
"license": "MIT",
"dependencies": {
"prop-types": "^15.8.1",
"react-docgen": "^5.4.3"
"react-docgen": "^6.0.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Upgrading react-docgen from ^5.4.3 to ^6.0.0 is a major version bump. Snyk's metadata indicates this is a breaking change ("isBreakingChange":true).

This project uses react-docgen via the dash-generate-components script (from the @plotly/dash-component-plugins devDependency) as part of its build process (build:py_and_r script).

Could you please confirm if the dash-generate-components tool and any related scripts in the build pipeline have been tested and are compatible with [email protected]? A breaking change here could potentially disrupt the component generation process.

},
"engines": {
"node": ">=8.10.0"
"node": ">=14.18.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The upgraded [email protected] now requires Node.js version >=14.18.0, up from >=8.10.0 in v5.4.3.

Has the project's build environment (including CI/CD pipelines) been verified to meet this new Node.js engine requirement? If the environment uses an older Node.js version, the build scripts utilizing react-docgen might fail.

@@ -17,7 +17,7 @@
"license": "MIT",
"dependencies": {
"prop-types": "^15.8.1",
"react-docgen": "^5.4.3"
"react-docgen": "^6.0.0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

react-docgen is listed in dependencies. However, its primary use in this project seems to be by dash-generate-components (a build tool from @plotly/dash-component-plugins, which is a devDependency).

Given that dash-test-components is private: true and react-docgen is used for build-time code generation, would it be more appropriate to list react-docgen under devDependencies for better semantic clarity? This would also align with its transitive dependencies like @babel/runtime being marked with dev: true in the package-lock.json.

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.

2 participants