wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.58k stars 534 forks source link

Critical security vulnerability due to crypto-js on v6.7.1 #779

Closed elkinjosetm closed 8 months ago

elkinjosetm commented 9 months ago

What react-native version are you using? 0.72.5

What react-native-pdf version are you using? 6.7.1

What platform does your issue occur on? (android/ios/both) both

Critical security vulnerability reported by dependabot because of crypto-js v3.2.0 used on this library. According to the report, it was patched on v4.2.0.

terryatgithub commented 9 months ago

Is there some updates about this security issue? it's encountered by us too. thank you

elkinjosetm commented 9 months ago

I had to force the newer version, in our package.json file, I did a few tests and the upgrade seems safe

bentleyAl commented 9 months ago

@elkinjosetm how did you manage to do this?

elkinjosetm commented 9 months ago

@bentleyAl by forcing pnpm (the package manager that we use) to use it. Yarn and npm provide a way for you to do just that.

# package.json
...
"pnpm": {
  "overrides": {
    "crypto-js": "^4.2.0"
  }
}
bentleyAl commented 9 months ago

@elkinjosetm Worked like a charm! Was not aware of npm overrides. Thank you!

AbhinayMe commented 8 months ago

If you are using Yarn, add "resolutions" in the package.json

# package.json
...
"resolutions": {
  "crypto-js": "^4.2.0"
},
wonday commented 8 months ago

Have bump to 6.7.2 and included this update.

Sheriff-Oladimeji commented 5 months ago

@elkinjosetm Worked like a charm! Was not aware of npm overrides. Thank you!

How were you able to use in it in npm , still getting errors