Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update image-size to 2.0.2 to prevent CWE-835 #11061

Closed
wants to merge 2 commits into from

Conversation

renebaudisch
Copy link

Image-size 1.02. is vulnerable to CWE-835.
This updates to 2.0.2.

@facebook-github-bot
Copy link
Contributor

Hi @renebaudisch!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

Copy link

netlify bot commented Apr 4, 2025

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit d60a0cc
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/67eff97ed6f7b100082011b7
😎 Deploy Preview https://deploy-preview-11061--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Apr 4, 2025

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🟠 69 🟢 98 🟢 100 🟢 100 Report
/docs/installation 🔴 48 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 71 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 62 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 62 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 63 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 73 🟢 100 🟢 100 🟠 86 Report

@slorber slorber added Argos Add this label to run UI visual regression tests. See argos.yml GH action. pr: maintenance This PR does not produce any behavior differences to end users when upgrading. labels Apr 4, 2025
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

This doesn't upgrade image-size consistently across the monorepo.

Also:

However, the v2 upgrade seems to have no major breaking change affecting us (I guess? CI will tell) so I'm ok to do this upgrade if it works.

@@ -104,7 +104,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-regexp": "^1.15.0",
"husky": "^8.0.3",
"image-size": "^1.0.2",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will only upgrade our monorepo, not third-party Docusaurus sites

Our mdx-loader package should also upgrade to v2 otherwise this creates a dependency duplicate that we won't even use

Copy link
Author

@renebaudisch renebaudisch Apr 4, 2025

Choose a reason for hiding this comment

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

I've seen the fix on 1.2.1 but when I check out image-size node_modules folder there is 1.2.0 used:

image

I'm pretty sure you are totally right by what you are telling me, it's just tools that seek for vulnerabilities like snyk will list you because of this exploit and this give people a bad meaning if they do not understand fully what happens.

BTW, I do not have a CLA and I don't know if my organization wants to do this again, this has been a pain doing it for AMP decades ago, but I still updated mdx-loader and pushed it as you can see.

About third-party websites, I dunno understand I guess. Wouldn't this just lead to merge this PR to the next release so it would be fixed in 3.7.1 or 3.7.2 at least, so each consumer would just need to fetch and update?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If your site gets 1.2.0, then you can use your package manager features to upgrade the deps to latest compatible version, or fully re-generate the lockfile.

I technically can't merge a PR if the CLA is not signed

Wouldn't this just lead to merge this PR to the next release so it would be fixed in 3.7.1 or 3.7.2 at least, so each consumer would just need to fetch and update?

Users of v2.0 and v3.0 can already upgrade to image-size 1.2.1. If we merge this PR, we only prevent them from using an older version, but they can already upgrade the lib on their own.

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

As you can see after upgrading the mdx-loader, our CI fails

There are probably breaking changes to handle in the code to ensure our code works with this new version.

Let me know if you need help. I can close this PR and open a new one doing the correct change, this way we can move on and you don't need to sign the CLA.

@renebaudisch
Copy link
Author

ok, there are also more than just "image-size", I'll close and use "overrides"

@slorber
Copy link
Collaborator

slorber commented Apr 7, 2025

Will do the upgrade in #11065

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Argos Add this label to run UI visual regression tests. See argos.yml GH action. pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants