plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

d3-interpolate depends on vulnerable d3-color

Open alexvanacker opened this issue 4 years ago • 11 comments

Following the vulnerability revealed in https://security.snyk.io/vuln/SNYK-JS-D3COLOR-1076592

plotly.js uses d3-interpolate 1.4.1 which still depends on vulnerable d3-color 1.4.1

Given plotly currenlty depends on d3-color 3.8 (see https://github.com/plotly/d3/blob/master/package.js) which is not affected, could we update this dependency to 3.0.1?

alexvanacker avatar Sep 30 '22 09:09 alexvanacker

Impacts angular 14

whittet avatar Oct 03 '22 21:10 whittet

The vulnerability in d3-color was patched for version >=3.1.0.

krisstern avatar Oct 07 '22 03:10 krisstern

image

"plotly.js": "^2.15.1",

Hi, Same here, Please advice.

peratik avatar Oct 11 '22 14:10 peratik

The d3-interpolate module is an ES module. To handle that we need to change our build processes quite a bit. This may include migrating from browserify to webpack. .AND. we are currently investigating that.

archmoj avatar Oct 11 '22 20:10 archmoj

Hey guys any update on this? Any temporary workarounds?

saumzzz avatar Oct 20 '22 06:10 saumzzz

They started with the migration to webpack. https://github.com/plotly/plotly.js/pull/6355

raulmarindev avatar Nov 02 '22 23:11 raulmarindev

Looks like now that webpack is merged to master the d3-interpolate package version can be updated to 3.0.1. I asked for same in a comment on this PR: https://github.com/plotly/plotly.js/pull/6344

whittet avatar Jan 03 '23 18:01 whittet

I did that in #6427, but I don’t know how to fix the build error.

If you want this fixed, feel free to help fix that PR.

flying-sheep avatar Jan 12 '23 17:01 flying-sheep

I found out if I use yarn I can add the following to package.json and then run yarn install (may need to delete the entire node_modules beforehand) to get rid of the vulnerability after upgrading plotly.js to version 2.17.1:

"resolutions": {
    "plotly.js/d3-interpolate/d3-color": "3.1.0"
}
Screenshot 2023-01-12 at 9 08 37 PM

krisstern avatar Jan 16 '23 02:01 krisstern

@krisstern Thanks! I don't have yarn, so my alternative is to upgrade npm to ^8.3.0, upgrade node to ^16.13.0 (due to Angular 14.2) and add the following to package.json:

"overrides": { "d3-color": "3.1.0", }

I'm sure a few other overrides could work, but this was the first one I found.

Although, this completely rewrote the angular site's package-lock.json.

whittet avatar Jan 16 '23 22:01 whittet

Addressed in #6463.

archmoj avatar Feb 01 '23 21:02 archmoj