Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion development/webpack/utils/plugins/LavamoatPlugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export const lavamoatUnsafeLayerRule = {
// 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

compiler.options.module.rules.push(lavamoatUnsafeLayerRule);
compiler.hooks.thisCompilation.tap('Layer', (compilation) => {
compilation.hooks.addEntry.tap('Layer', (entry, options) => {
Expand Down
6 changes: 0 additions & 6 deletions lavamoat/build-system/policy-override.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,15 @@
"path": true
},
"packages": {
"eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true,
"eslint>@eslint-community/eslint-utils": true,
"eslint-plugin-jest>@typescript-eslint/utils>@typescript-eslint/types": true,
"eslint-plugin-jest>@typescript-eslint/utils>@typescript-eslint/scope-manager": true,
"eslint-plugin-jest>@typescript-eslint/utils>webpack>eslint-scope": true,
"eslint-plugin-mocha>eslint-utils": true,
"@typescript-eslint/parser>@typescript-eslint/types": true,
"eslint": true,
"semver": true,
"@typescript-eslint/parser>@typescript-eslint/scope-manager": true,
"eslint>eslint-scope": true,
"eslint>eslint-utils": true,
"webpack>eslint-scope": true
}
},
Expand All @@ -134,7 +131,6 @@
"path": true
},
"packages": {
"eslint>eslint-utils": true,
"eslint-plugin-mocha>eslint-utils": true,
"@typescript-eslint/parser>@typescript-eslint/types": true,
"eslint": true,
Expand All @@ -157,13 +153,11 @@
"path": true
},
"packages": {
"eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true,
"eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": true,
"@typescript-eslint/parser>@typescript-eslint/types": true,
"eslint": true,
"@typescript-eslint/parser>@typescript-eslint/scope-manager": true,
"eslint>eslint-scope": true,
"eslint>eslint-utils": true,
"webpack>eslint-scope": true
}
},
Expand Down
33 changes: 24 additions & 9 deletions lavamoat/build-system/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@
},
"@babel/eslint-parser>@nicolo-ribaudo/eslint-scope-5-internals": {
"packages": {
"webpack>eslint-scope": true
"@babel/eslint-parser>@nicolo-ribaudo/eslint-scope-5-internals>eslint-scope": true
}
},
"@noble/hashes": {
Expand Down Expand Up @@ -1159,13 +1159,11 @@
},
"packages": {
"@typescript-eslint/parser>@typescript-eslint/scope-manager": true,
"eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true,
"@typescript-eslint/parser>@typescript-eslint/types": true,
"eslint": true,
"eslint>eslint-scope": true,
"webpack>eslint-scope": true,
"eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": true,
"eslint>eslint-utils": true
"eslint-plugin-jest>@typescript-eslint/experimental-utils>eslint-utils": true
}
},
"eslint-plugin-jest>@typescript-eslint/utils>@typescript-eslint/scope-manager": {
Expand Down Expand Up @@ -1198,7 +1196,6 @@
"@typescript-eslint/utils": true,
"eslint": true,
"webpack>eslint-scope": true,
"eslint>eslint-utils": true,
"eslint-plugin-mocha>eslint-utils": true
}
},
Expand All @@ -1216,15 +1213,13 @@
"eslint>@eslint-community": true,
"@typescript-eslint/parser>@typescript-eslint/scope-manager": true,
"eslint-plugin-jest>@typescript-eslint/utils>@typescript-eslint/scope-manager": true,
"eslint-plugin-jest>@typescript-eslint/experimental-utils>@typescript-eslint/types": true,
"@typescript-eslint/parser>@typescript-eslint/types": true,
"eslint-plugin-jest>@typescript-eslint/utils>@typescript-eslint/types": true,
"@typescript-eslint/parser>@typescript-eslint": true,
"eslint": true,
"eslint-plugin-jest>@typescript-eslint/utils>eslint-scope": true,
"eslint>eslint-scope": true,
"webpack>eslint-scope": true,
"eslint-plugin-jest>@typescript-eslint/utils>webpack>eslint-scope": true,
"eslint>eslint-utils": true,
"eslint-plugin-mocha>eslint-utils": true,
"semver": true
}
Expand Down Expand Up @@ -1620,7 +1615,7 @@
"globals": {
"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? 🤔

}
},
"bify-module-groups": {
Expand Down Expand Up @@ -1768,6 +1763,8 @@
"path.resolve": true
},
"globals": {
"console.info": true,
"console.trace": true,
"console.warn": true,
"process.env": true,
"process.versions.node": true
Expand Down Expand Up @@ -2960,6 +2957,24 @@
"process.env.NODE_ENV": true
}
},
"@babel/eslint-parser>@nicolo-ribaudo/eslint-scope-5-internals>eslint-scope": {
"builtin": {
"assert": true
},
"packages": {
"eslint>eslint-scope>esrecurse": true,
"@babel/eslint-parser>@nicolo-ribaudo/eslint-scope-5-internals>eslint-scope>estraverse": true
}
},
"eslint-plugin-jest>@typescript-eslint/utils>eslint-scope": {
"builtin": {
"assert": true
},
"packages": {
"eslint>eslint-scope>esrecurse": true,
"eslint-plugin-jest>@typescript-eslint/utils>eslint-scope>estraverse": true
}
},
"eslint>eslint-scope": {
"builtin": {
"assert": true
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
"@open-rpc/schema-utils-js": "^2.0.5",
"@open-rpc/test-coverage": "^2.2.4",
"@playwright/test": "^1.54.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
"@sentry/cli": "^2.56.0",
"@slack/types": "^2.14.0",
"@slack/webhook": "^7.0.5",
Expand Down Expand Up @@ -605,7 +605,7 @@
"chokidar": "^3.6.0",
"commander": "^14.0.0",
"concurrently": "^8.2.2",
"copy-webpack-plugin": "^13.0.0",
"copy-webpack-plugin": "^13.0.1",
"core-js-pure": "^3.38.0",
"crypto-browserify": "^3.12.0",
"css-loader": "^6.10.0",
Expand Down Expand Up @@ -651,7 +651,7 @@
"gulp-stylelint": "^13.0.0",
"gulp-watch": "^5.0.1",
"gulp-zip": "^5.1.0",
"html-bundler-webpack-plugin": "^4.21.1",
"html-bundler-webpack-plugin": "^4.22.0",
"http-server": "^14.1.1",
"https-browserify": "^1.0.0",
"husky": "^8.0.3",
Expand Down Expand Up @@ -722,8 +722,8 @@
"style-loader": "^0.21.0",
"stylelint": "^13.6.1",
"tailwindcss": "^3.4.1",
"terser": "^5.7.0",
"terser-webpack-plugin": "^5.3.14",
"terser": "^5.44.1",
"terser-webpack-plugin": "^5.3.16",
"through2": "^4.0.2",
"ts-node": "^10.9.2",
"tsx": "^4.20.6",
Expand All @@ -738,7 +738,7 @@
"wait-on": "^7.0.1",
"watchify": "^4.0.0",
"webextension-polyfill": "^0.8.0",
"webpack": "5.99.9",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.2",
"ws": "^8.17.1",
Expand Down
Loading
Loading