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

chore: Bump dependencies to reduce vulnerabilities in /ui #4654

Merged
merged 7 commits into from
Oct 20, 2024

Conversation

peruukki
Copy link
Contributor

What this PR does / why we need it:

Bump several dependencies to reduce the number of vulnerabilities reported by yarn audit from 57 to 3.

Before:

% yarn audit --summary
yarn audit v1.22.22
57 vulnerabilities found - Packages audited: 1713
Severity: 2 Low | 21 Moderate | 31 High | 3 Critical
Done in 2.16s.

After:

% yarn audit
yarn audit v1.22.22
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ cookie accepts cookie name, path, and domain with out of     │
│               │ bounds characters                                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ cookie                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in>=0.7.0                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ msw                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ msw > cookie                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1099846                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │ PostCSS line return parsing error                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ postcss                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in>=8.4.31                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-scripts                                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ react-scripts > resolve-url-loader > postcss                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1094544                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Inefficient Regular Expression Complexity in nth-check       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ nth-check                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in>=2.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-scripts                                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ react-scripts > @svgr/webpack > @svgr/plugin-svgo > svgo >   │
│               │ css-select > nth-check                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1095141                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
3 vulnerabilities found - Packages audited: 1704
Severity: 1 Low | 1 Moderate | 1 High
Done in 2.13s.

The remaining vulnerabilities are:

The cookie one comes via msw that is only used in tests and actively developed and has a related issue, so I would expect it to be resolved in an update in the near future.

The other two could potentially be resolved with yarn's resolutions, but they are only used during build time, so they should not be a concern in practice. Furthermore, we should try to get rid of react-scripts anyway since it's no longer maintained, and the two vulnerabilities should become obsolete with that.

Which issue(s) this PR fixes:

This is related to #4451, but it's debatable whether this resolves it for now, maybe not.

Misc

After upgrading the babel packages, I started seeing the problem in babel/babel#16716, but removing node_modules as suggested in babel/babel#16716 (comment) fixed it. 🤷

I split the upgrades into several commits, and some commit messages have additional details about non-trivial changes, especially the last two.

This resolves a vulnerability in word-wrap:
GHSA-j8xg-fqg3-53r7.

Signed-off-by: Harri Lehtola <[email protected]>
The older version depended on taffydb that has a vulnerability with no
patched version available. The latest version no longer uses it.

Signed-off-by: Harri Lehtola <[email protected]>
This resolves 1 critical and 1 high level vulnerability in @xmldom/xmldom
and path-to-regexp.

Signed-off-by: Harri Lehtola <[email protected]>
This resolves 1 high and 9 moderate level vulnerabilities reported by
`yarn audit`.

Signed-off-by: Harri Lehtola <[email protected]>
This resolves 16 high level vulnerabilities reported by `yarn audit`.

Signed-off-by: Harri Lehtola <[email protected]>
"defaults" (https://browsersl.ist/#q=defaults) is the recommended starting
point these days, it's a shorthand for "> 0.5%, last 2 versions, Firefox
ESR, not dead". Using it gets rid of a couple autoprefixer related warnings
that started appearing after dependency updates.

Check the previous production configuration at
https://browsersl.ist/#q=%3E0.2%25%2C+not+dead%2C+not+op_mini+all if you
want to compare what changed.

Signed-off-by: Harri Lehtola <[email protected]>
This resolves 2 critical, 11 high, 7 moderate and 1 low level vulnerability
reported by `yarn audit`.

@babel/plugin-proposal-private-property-in-object is added to
devDependencies due to this warning when running the tests:

> One of your dependencies, babel-preset-react-app, is importing the
> "@babel/plugin-proposal-private-property-in-object" package without
> declaring it in its dependencies. This is currently working because
> "@babel/plugin-proposal-private-property-in-object" is already in your
> node_modules folder for unrelated reasons, but it may break at any time.
>
> babel-preset-react-app is part of the create-react-app project, which
> is not maintianed (sic) anymore. It is thus unlikely that this bug will
> ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
> your devDependencies to work around this error. This will make this message
> go away.

Signed-off-by: Harri Lehtola <[email protected]>
Copy link
Collaborator

@tokoko tokoko left a comment

Choose a reason for hiding this comment

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

lgtm, thanks

@tokoko tokoko merged commit 986dc92 into feast-dev:master Oct 20, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants