Skip to content

Security: Build-time remote code download lacks integrity verification#2229

Open
tuanaiseo wants to merge 1 commit intowxt-dev:mainfrom
tuanaiseo:contribai/fix/security/build-time-remote-code-download-lacks-in
Open

Security: Build-time remote code download lacks integrity verification#2229
tuanaiseo wants to merge 1 commit intowxt-dev:mainfrom
tuanaiseo:contribai/fix/security/build-time-remote-code-download-lacks-in

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

The url: import mechanism downloads arbitrary remote JavaScript and bundles it into the extension build. This creates a supply-chain risk if the remote source is compromised or unexpectedly changed, since no checksum/signature verification is enforced before inclusion.

Severity: medium
File: packages/wxt/src/core/builders/vite/plugins/download.ts

Solution

Require integrity metadata (e.g., SHA-256) for url: imports, verify content hash before caching/bundling, and optionally enforce an allowlist of approved domains.

Changes

  • packages/wxt/src/core/builders/vite/plugins/download.ts (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The `url:` import mechanism downloads arbitrary remote JavaScript and bundles it into the extension build. This creates a supply-chain risk if the remote source is compromised or unexpectedly changed, since no checksum/signature verification is enforced before inclusion.

Affected files: download.ts

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
@tuanaiseo tuanaiseo requested a review from aklinker1 as a code owner April 3, 2026 23:07
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 3, 2026

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 69f1b8f
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/69d048383b95cb00087e89a8
😎 Deploy Preview https://deploy-preview-2229--creative-fairy-df92c4.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 project configuration.

@github-actions github-actions bot added the pkg/wxt Includes changes to the `packages/wxt` directory label Apr 3, 2026
@PatrykKuniczak
Copy link
Copy Markdown
Collaborator

@tuanaiseo How it's possible to make supply-chain attack on this code, without sha?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/wxt Includes changes to the `packages/wxt` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants