NPM install found 5 high severity vulnerabilities
npm init
npm install --save gatsby-source-contentful
The package shouldn't contain anything above medium severity vulnerabilities.
npm audit and npm audit fix leave 5 high severity vulnerabilities, all are related to utils-extend which hasn't been updated in more than 5 years
Empty project, and currently ongoing projects leave the same warnings.
@vladar as far as I remember we as plugin maintainers should not touch the yarn.lock in PRs.
How should be proceed?
I think you can touch yarn.lock. It is just for monorepo (tests, local development, publishing, etc). When someone installs contentful plugin, yarn.lock of the monorepo is not used in any way.
So you can update the dependency in package.json of the plugin and run yarn in the monorepo root to update yarn.lock.
Check this PR for example: https://github.com/gatsbyjs/gatsby/pull/24788
@vladar 馃啑
Okay I check this in detail. https://www.npmjs.com/package/base64-img wasn't updated for a while and the way we implement it, we do a request to Contentful every time we need a base64 version of an image.
I guess we should do the following:
await fs.readFile('/path/to/file.jpg', {encoding: 'base64'});This should:
Related: #24220
Will this vulnerability can have any impact on a production gatsby site?
No as the code won't be executed at all in a production environment :)
This will be fixed in the next major version as it requires potentially breaking refactoring to get rid of these dependencies.
See #25249
@axe312ger I just wanted to follow up on this i installed the latest next package and I'm still getting the vulnerability error.
@MikeyUchiha sorry, there is no fix implemented yet in that version. We probably have to postone it further except somebody picks it up.
We still need to change the base64 behavior as mentioned in https://github.com/gatsbyjs/gatsby/issues/24679#issuecomment-641885490 to get rid of all security issues
There is a ticket for changing the base64 behaviour: https://github.com/gatsbyjs/gatsby/issues/24220
@axe312ger Thank you for the update!
As https://github.com/gatsbyjs/gatsby/pull/25249 was merged and released I'll close this one.
@LekoArts are you sure the vulnerabilites are fixed? I didn't update the related packages in that branch (at least on purpose)
Sorry, I read it as it'd be fixed.
Most helpful comment
This will be fixed in the next major version as it requires potentially breaking refactoring to get rid of these dependencies.
See #25249