Anidetrix / rollup-plugin-styles

🎨 Universal Rollup plugin for styles: PostCSS, Sass, Less, Stylus and more.
https://anidetrix.github.io/rollup-plugin-styles
MIT License
242 stars 43 forks source link

posibility of a 3.14.2 release for rollup-plugin-styles with less strict cssnano version dependency #188

Open bestrivens001 opened 2 years ago

bestrivens001 commented 2 years ago

Hi, @izevo @Anidetrix,

Issue Description

I noticed that a vulnerability is introduced in rollup-plugin-styles@3.14.1: Vulnerability CVE-2021-33587 affects package css-what (versions:<5.0.1): https://snyk.io/vuln/SNYK-JS-CSSWHAT-1298035 The above vulnerable package is referenced by rollup-plugin-styles@3.14.1 via: rollup-plugin-styles@3.14.1 ➔ cssnano@4.1.11 ➔ cssnano-preset-default@4.0.8 ➔ postcss-svgo@4.0.3 ➔ svgo@1.3.2 ➔ css-select@2.1.0 ➔ css-what@3.4.2

Since rollup-plugin-styles@3.14.1 (13,494 downloads per week) is referenced by 27 downstream projects (e.g., padl 1.0.3 (latest version), microsite 1.2.2-next.0 (latest version), @quilted/sewing-kit-plugins 0.2.29 (latest version), snowpack-plugin-rollup-bundle 0.4.4 (latest version), @hashicorp/sentinel-codemirror 0.0.8 (latest version)), the vulnerability CVE-2021-33587 can be propagated into these downstream projects and expose security threats to them via the following package dependency paths: (1)@gem-mine/script-rollup@2.7.5 ➔ rollup-plugin-styles@3.14.1 ➔ cssnano@4.1.11 ➔ cssnano-preset-default@4.0.8 ➔ postcss-svgo@4.0.3 ➔ svgo@1.3.2 ➔ css-select@2.1.0 ➔ css-what@3.4.2 (2)padl@1.0.3 ➔ rollup-plugin-styles@3.14.1 ➔ cssnano@4.1.11 ➔ cssnano-preset-default@4.0.8 ➔ postcss-svgo@4.0.3 ➔ svgo@1.3.2 ➔ css-select@2.1.0 ➔ css-what@3.4.2 ......

If rollup-plugin-styles@3.14.* removes the vulnerable package from the above version, then its fixed version can help downstream users decrease their pain.

Given the large number of downstream users, could you help update your package to remove the vulnerability from rollup-plugin-styles@3.14.1 ?

Fixing suggestions

In rollup-plugin-styles@3.14.2, maybe you can kindly try to perform the following upgrade : cssnano ^4.1.10 ➔ ^5.0.0;

Note: cssnano@5.0.0(>=5.0.0-rc.0) transitively depends on css-what@5.0.1 which has fixed the vulnerability CVE-2021-33587

Thank you for your attention to this issue and welcome to share other ways to resolve the issue.

Best regards, ^_^

zhihuahuang commented 2 years ago

@Anidetrix I see that cssnano@5.0.0 has been updated in main branch, can you release a new npm version?

peschee commented 2 years ago

I would love a new release as well. Is this something I can help with?