Skip to content

Conversation

@davidmurdoch
Copy link
Contributor

@davidmurdoch davidmurdoch commented Jan 6, 2026

Description

Update webpack and related deps.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Updates the build toolchain and security policies to align with newer webpack and plugin releases.

  • Bumps webpack to ^5.104.1 and updates related deps: terser ^5.44.1, terser-webpack-plugin ^5.3.16, copy-webpack-plugin ^13.0.1, html-bundler-webpack-plugin ^4.22.0, @pmmmwh/react-refresh-webpack-plugin ^0.6.2; refreshes yarn.lock and transitive deps (e.g., browserslist, es-module-lexer, enhanced-resolve, schema-utils).
  • Adjusts LavaMoat configs: refines policy.json/policy-override.json package mappings (notably eslint-scope paths), tweaks allowed globals (console.info, console.trace, process), and adds explicit entries for new scopes.
  • In LavamoatPlugin/index.ts, stops setting compiler.options.experiments.layers, keeping the unsafe layer rule/assignment logic unchanged.

Written by Cursor Bugbot for commit 9779cd4. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@davidmurdoch
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot metamaskbot added the team-extension-platform Extension Platform team label Jan 6, 2026
@socket-security
Copy link

socket-security bot commented Jan 6, 2026

@socket-security
Copy link

socket-security bot commented Jan 6, 2026

Caution

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Action Severity Alert  (click "▶" to expand/collapse)
Block Low
Publisher changed: npm loader-runner is now published by evilebottnawi instead of sokra

New Author: evilebottnawi

Previous Author: sokra

From: ?npm/[email protected]npm/[email protected]

ℹ Read more on: This package | This alert | What is new author?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn Low
Potential code anomaly (AI signal): npm html-bundler-webpack-plugin is 90.0% likely to have a medium risk anomaly

Notes: The code is a thin wrapper around vm.Script and is not itself obfuscated or demonstrably malicious. However it is inherently risky: it executes arbitrary code strings in a vm context that inherits any objects supplied by the caller. If untrusted code or an unsafe context is used, this can lead to arbitrary code execution, data leakage, or access to OS resources. Mitigations would be to ensure contexts do not contain host capabilities, add execution time/memory limits, and validate or sandbox inputs. No hardcoded secrets or obvious backdoors were found in this fragment.

Confidence: 0.90

Severity: 0.65

From: package.jsonnpm/[email protected]

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Ignoring alerts on:

View full report

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@davidmurdoch
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policy update failed. You can review the logs or retry the policy update here

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 6, 2026

✨ Files requiring CODEOWNER review ✨

📜 @MetaMask/policy-reviewers (2 files, +24 -15)
  • 📁 lavamoat/
    • 📁 build-system/
      • 📄 policy-override.json +0 -6
      • 📄 policy.json +24 -9

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.

@davidmurdoch
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policy update failed. You can review the logs or retry the policy update here

@davidmurdoch
Copy link
Contributor Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 7, 2026

Builds ready [2c45442]
UI Startup Metrics (1260 ± 95 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1260105515279513211418
load105384713608911001199
domContentLoaded104884113508910921192
domInteractive251589182275
firstPaint151641068111183297
backgroundConnect21219224910219231
firstReactRender1492841622
getState3817110164362
initialActions105112
loadScripts842652114989887989
setupStore1272841321
numNetworkReqs171171171168
BrowserifyPower User HomeuiStartup------
load------
domContentLoaded------
domInteractive------
firstPaint------
backgroundConnect------
firstReactRender------
getState------
initialActions------
loadScripts------
setupStore------
numNetworkReqs------
WebpackStandard HomeuiStartup775651100369810884
load62557179853644764
domContentLoaded62056579152638757
domInteractive231593171979
firstPaint1015928949126208
backgroundConnect315133315098
firstReactRender14113041620
getState3215123164355
initialActions105111
loadScripts61756378251635749
setupStore1163661129
numNetworkReqs171172171168
WebpackPower User HomeuiStartup------
load------
domContentLoaded------
domInteractive------
firstPaint------
backgroundConnect------
firstReactRender------
getState------
initialActions------
loadScripts------
setupStore------
numNetworkReqs------
FirefoxBrowserifyStandard HomeuiStartup13711081189016814871659
load108693013169811661260
domContentLoaded108692913159811661259
domInteractive67312363887133
firstPaint------
backgroundConnect54202034670178
firstReactRender1294041217
getState146107161131
initialActions103112
loadScripts105391612438311181213
setupStore144118171144
numNetworkReqs19981191375
BrowserifyPower User HomeuiStartup25191525388555329263281
load1717962269352721832483
domContentLoaded1716961269352621822482
domInteractive79323627984298
firstPaint------
backgroundConnect3942113223985511155
firstReactRender19115882428
getState996118927111165
initialActions217123
loadScripts1417946251544419322232
setupStore704111920636253
numNetworkReqs68201863675165
WebpackStandard HomeuiStartup16371301214017917531974
load13421132169912314181597
domContentLoaded13411132169812314171597
domInteractive863133355107192
firstPaint------
backgroundConnect60192444565157
firstReactRender15115651624
getState176159271492
initialActions103122
loadScripts13061117164211713701575
setupStore226152301898
numNetworkReqs20991211384
WebpackPower User HomeuiStartup27611593466756231553405
load20451154290851624902727
domContentLoaded20451153290851624902726
domInteractive772992110673203
firstPaint------
backgroundConnect3192411783153631103
firstReactRender19126382330
getState11559992126104213
initialActions203122
loadScripts18161131273745522112553
setupStore544111914955180
numNetworkReqs68251913773177
📊 Page Load Benchmark Results

Current Commit: 2c45442 | Date: 1/7/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±55ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 732ms (±52ms) 🟢 | historical mean value: 729ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±14ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 55ms 1.02s 1.35s 1.07s 1.35s
domContentLoaded 732ms 52ms 705ms 1.03s 757ms 1.03s
firstPaint 78ms 14ms 60ms 204ms 84ms 204ms
firstContentfulPaint 78ms 14ms 60ms 204ms 84ms 204ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 23 Bytes (0%)

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Jan 7, 2026

Builds ready [9779cd4]
UI Startup Metrics (1275 ± 105 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12751067156510513481478
load106686813179911271226
domContentLoaded106086213119811231221
domInteractive2516116192179
firstPaint1416587192182263
backgroundConnect21219725110215234
firstReactRender1392931521
getState3819143154167
initialActions105111
loadScripts85565011141009181022
setupStore1273651423
numNetworkReqs181182171168
BrowserifyPower User HomeuiStartup17051415220117317862041
load1024847133710910931214
domContentLoaded1011840133010710781199
domInteractive2716102182575
firstPaint181631260160208274
backgroundConnect24118760976242455
firstReactRender15103531619
getState17513328230191235
initialActions103112
loadScripts8076491131105872999
setupStore1554081436
numNetworkReqs68522403162127
WebpackStandard HomeuiStartup799652105280846965
load64157490563660777
domContentLoaded63656989662655772
domInteractive241590172175
firstPaint1046033955134221
backgroundConnect2851183134106
firstReactRender15102941625
getState3114130164153
initialActions105112
loadScripts63356689361653762
setupStore1153761226
numNetworkReqs171171161167
WebpackPower User HomeuiStartup1180946184519412271664
load724600115096808893
domContentLoaded717593114396798888
domInteractive31171492824102
firstPaint1306482999146263
backgroundConnect45758110436329
firstReactRender16122321619
getState13912121113145162
initialActions102111
loadScripts714590113494793879
setupStore1494871334
numNetworkReqs66522222561126
FirefoxBrowserifyStandard HomeuiStartup13781117213019414941687
load1108943163013611881386
domContentLoaded1107943162913611871385
domInteractive65321953685135
firstPaint------
backgroundConnect52183144955153
firstReactRender13102631322
getState146124151333
initialActions102022
loadScripts1076920160412111201310
setupStore225842841246
numNetworkReqs19985191476
BrowserifyPower User HomeuiStartup25891599408356329473336
load17401005270755522192561
domContentLoaded17391005270755522192561
domInteractive84308979592207
firstPaint------
backgroundConnect4142512904129161113
firstReactRender2111134142537
getState1155795598119228
initialActions214123
loadScripts1419972254146319612380
setupStore485100014225165
numNetworkReqs75501562793137
WebpackStandard HomeuiStartup15831284202017016861958
load13281099173911113721567
domContentLoaded13281098173811113721567
domInteractive792815134106131
firstPaint------
backgroundConnect59182294072145
firstReactRender15106151620
getState185281321453
initialActions102122
loadScripts12951087172210413351537
setupStore184116231585
numNetworkReqs19880191474
WebpackPower User HomeuiStartup26781647370555130773434
load20171179304051824472668
domContentLoaded20171178304051824472668
domInteractive1022999717173426
firstPaint------
backgroundConnect3392211383713811112
firstReactRender211393112346
getState1015929738106186
initialActions218123
loadScripts17531159302346922022508
setupStore535105416517164
numNetworkReqs68401553089127
📊 Page Load Benchmark Results

Current Commit: 9779cd4 | Date: 1/7/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.06s (±62ms) 🟡 | historical mean value: 1.04s ⬆️ (historical data)
  • domContentLoaded-> current mean value: 739ms (±60ms) 🟢 | historical mean value: 725ms ⬆️ (historical data)
  • firstContentfulPaint-> current mean value: 78ms (±11ms) 🟢 | historical mean value: 77ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.06s 62ms 1.03s 1.33s 1.27s 1.33s
domContentLoaded 739ms 60ms 711ms 997ms 949ms 997ms
firstPaint 78ms 11ms 64ms 172ms 92ms 172ms
firstContentfulPaint 78ms 11ms 64ms 172ms 92ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 23 Bytes (0%)

@davidmurdoch
Copy link
Contributor Author

@SocketSecurity ignore npm/[email protected]

"console.log": true,
"console.warn": true,
"process.exit": true
"process": true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

concerning? 🤔

@davidmurdoch davidmurdoch mentioned this pull request Jan 7, 2026
7 tasks
@davidmurdoch davidmurdoch marked this pull request as ready for review January 7, 2026 20:32
@davidmurdoch davidmurdoch requested a review from a team as a code owner January 7, 2026 20:32
// Unsafe layer plugin that applies the layer and assigns the unsafeEntries to it
export const lavamoatUnsafeLayerPlugin: WebpackPluginInstance = {
apply: (compiler) => {
compiler.options.experiments.layers = true;
Copy link

Choose a reason for hiding this comment

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

Removal of experiments.layers may break LavaMoat layer isolation

High Severity

The line compiler.options.experiments.layers = true was removed, but the plugin still uses webpack's layer functionality via issuerLayer: 'unsafe' and entryData.options.layer. Webpack's layers feature requires experiments.layers to be enabled. If not enabled by default in webpack 5.104.1, this would cause the unsafe layer isolation to silently fail—security-sensitive entries (scripts/inpage.js, bootstrap, service-worker.ts) that should run outside LavaMoat protection may not be properly isolated. This could be a silent security regression.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its default in webpack now

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

Labels

size-S team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants