Skip to content

Update yarn dependencies to fix moderate JS vulnerabilities#5889

Merged
mitchellhenke merged 2 commits intomainfrom
mitchellhenke/yarn-audit
Feb 1, 2022
Merged

Update yarn dependencies to fix moderate JS vulnerabilities#5889
mitchellhenke merged 2 commits intomainfrom
mitchellhenke/yarn-audit

Conversation

@mitchellhenke
Copy link
Contributor

@mitchellhenke mitchellhenke commented Feb 1, 2022

GitHub reminds me daily of our vulnerable JS packages (that are not vulnerabilities in the deployed environment as far as I understand them), so I wanted to fix them.

svgo was the most significant change with a major version upgrade that includes a new configuration format.

image

Yarn Audit Before PR
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │  Inefficient Regular Expression Complexity in                │
│               │ chalk/ansi-regex                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ansi-regex                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ mocha                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ mocha > wide-align > string-width > strip-ansi > ansi-regex  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1004946                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │ Exposure of Sensitive Information to an Unauthorized Actor   │
│               │ in nanoid                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ nanoid                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.1.31                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ mocha                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ mocha > nanoid                                               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1006897                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │ Inefficient Regular Expression Complexity in nth-check       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ nth-check                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ svgo                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ svgo > css-select > nth-check                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1004967                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │ ReDoS in Sec-Websocket-Protocol header                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ws                                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=7.4.6                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jsdom                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ jsdom > ws                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1005162                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │ json-schema is vulnerable to Prototype Pollution             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ json-schema                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.4.0                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jsdom                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ jsdom > request > http-signature > jsprim > json-schema      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1006724                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │ Exposure of Sensitive Information to an Unauthorized Actor   │
│               │ in nanoid                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ nanoid                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.1.31                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss > nanoid                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1006897                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │ Exposure of Sensitive Information to an Unauthorized Actor   │
│               │ in nanoid                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ nanoid                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.1.31                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint > postcss > nanoid                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1006897                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
Yarn Audit After PR
0 vulnerabilities found - Packages audited: 1045
✨  Done in 1.21s.

@mitchellhenke mitchellhenke requested a review from aduth February 1, 2022 17:18
Makefile Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I recall having an in-progress branch somewhere with the SVGO upgrade, and it requires some alternative to the (now-deprecated) flags here, through a config file. Let me see if I can dig that up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, I forgot to include what I had for the file! Added it

Copy link
Contributor

Choose a reason for hiding this comment

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

Whoops, I forgot to include what I had for the file! Added it

Gotcha 👍 Mine included the "default preset" and modified a few of the defaults from there, but if it can be done at the top-level like you have, I think that works better.

module.exports = {
  multipass: true,
  plugins: [
    {
      name: 'preset-default',
      params: {
        overrides: {
          minifyStyles: false,
          removeViewBox: false,
        },
      },
    },
    {
      name: 'removeAttrs',
      params: {
        attrs: 'data-name',
      },
    },
  ],
};

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/yarn-audit branch from 26ebbe5 to 05b3350 Compare February 1, 2022 17:26
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/yarn-audit branch from 05b3350 to 3119966 Compare February 1, 2022 17:29
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@mitchellhenke mitchellhenke merged commit 29d009f into main Feb 1, 2022
@mitchellhenke mitchellhenke deleted the mitchellhenke/yarn-audit branch February 1, 2022 18:07
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