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

fix: upgrade rollup 4.22.4 to avoid XSS #18180

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

Conversation

delihiros
Copy link

Description

rollup before version 4.22.4 has a DOM Clobbering vulnerability which leads to XSS.
Considering the risk, we would like to upgrade the version.

Copy link

stackblitz bot commented Sep 24, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@delihiros
Copy link
Author

delihiros commented Sep 24, 2024

Hi, I've resolved the conflict. Could you please review it again so it can be merged? Thank you.

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

Let's wait until rollup/rollup#5672 is fixed, otherwise this will break many apps. (note that the CVE only affects non-ESM outputs)

For now, you can simply bump the transitive dependency on your side.

package.json Outdated Show resolved Hide resolved
packages/vite/package.json Outdated Show resolved Hide resolved
@delihiros
Copy link
Author

The type definition has changed in estree 1.0.6, and vite needs to be addressed in order to successfully build the commit.

You can view the relevant commit here: DefinitelyTyped Commit.

One possible solution to this issue is to use a type assertion, as I understand that the local variable is of type Identifier.
We could modify the code in vite/packages/vite/src/node/plugins/importAnalysis.ts as follows:

  const importedName = (spec.local as Identifier).name;

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.

6 participants