Skip to content

Commit e36e1de

Browse files
authored
fix: whitelist process env keys (#557)
PSA: previous versions included process.env in the bundles so tokens, keys etc might be compromised please reset those to be safe!!
1 parent 0554d92 commit e36e1de

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/config/karma.conf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const isWebworker = process.env.AEGIR_RUNNER === 'webworker'
1010

1111
// Env to pass in the bundle with DefinePlugin
1212
const env = {
13+
'process.env': JSON.stringify(process.env),
1314
TEST_DIR: JSON.stringify(fromRoot('test')),
1415
TEST_BROWSER_JS: hasFile('test', 'browser.js')
1516
? JSON.stringify(fromRoot('test', 'browser.js'))

src/config/webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ const base = (env, argv) => {
108108
]
109109
},
110110
plugins: [
111-
new webpack.DefinePlugin({ 'process.env': JSON.stringify(process.env) })
111+
new webpack.DefinePlugin({
112+
'process.env': JSON.stringify({
113+
DEBUG: process.env.DEBUG,
114+
NODE_ENV: process.env.NODE_ENV
115+
})
116+
})
112117
],
113118
target: 'web',
114119
node: process.env.AEGIR_NODE === 'false' ? {

0 commit comments

Comments
 (0)