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

Security update esbuild & Astro #11149

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

debiru
Copy link
Contributor

@debiru debiru commented Mar 4, 2025

Description (required)

This PR updates esbuild and the packages that depend on esbuild.

Changed to use esbuild 0.25.0

The overrides section is for the tsm package.

Related issues & labels (optional)

Copy link

netlify bot commented Mar 4, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2e3aabd
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/67c7725b2d3fce0008b22950
😎 Deploy Preview https://deploy-preview-11149--astro-docs-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.

package.json Outdated
Comment on lines 87 to 89
},
"overrides": {
"esbuild": "^0.25.0"
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for looking into this @debiru! This shouldn‘t be needed though. Can you explain why you added it?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, sorry, I skipped over the line in the PR comment:

The overrides section is for the tsm package.

Do you think this upgrade is necessary? tsm is only used to execute a few scripts we have in CI, not run esbuild’s dev server, so I suspect it’s likely harmless to leave in place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@delucis

Do you think this upgrade is necessary? tsm is only used to execute a few scripts we have in CI, not run esbuild’s dev server, so I suspect it’s likely harmless to leave in place.

That is certainly true from that perspective.

I ran pnpm audit locally and even updated the tsm dependency package to avoid the warning, which is why I included the diff.

If you say it is unnecessary, it may be unnecessary. Should I not add this overrides section?

Note: The original writing style would no longer result in a version newer than 0.25.0, so this has been corrected in 65d3959.

The result of pnpm audit

key value
moderate esbuild enables any website to send any requests to the development server and read the response
Package esbuild
Vulnerable versions <=0.24.2
Patched versions >=0.25.0
Paths . > [email protected] > [email protected]
More info GHSA-67mh-4wv8-2f99

1 vulnerabilities found
Severity: 1 moderate

Copy link
Member

Choose a reason for hiding this comment

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

npm audit isn't perfect because often a vulnerability only exists in a specific scenario, so if you're not using code in that way, the vulnerability doesn't impact you.

If I understood correctly, that seems to be the case here? Just updating Astro would be enough to solve the vulnerable case (running a dev server). It is safe to continue depending on the older, "vulnerable" version of esbuild via tsm, because that does not run a dev server, so is not impacted by the vulnerability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@delucis

Thank you. I think that is true.

The question that remains is whether it is ok to keep getting warnings when running pnpm audit.

If this is deemed not to be a problem, then I will remove the overrides section.

... I would remove the overrides section, as it seemed to say that there is no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants