Skip to content

Commit ab26912

Browse files
tniessenRafaelGSS
authored andcommitted
msi: do not create AppData\Roaming\npm
This effectively reverts e431cae due to security concerns. The directory is being created with elevated privileges but its path may depend on an unprivileged user's environment variables. Creating a directory in certain sensitive locations can cause Windows to become inoperable. Creating AppData\Roaming\npm was an intentional addition in order to resolve nodejs/node-v0.x-archive#8141, which appears to have been a common issue for users of npm. However, this was implemented before 4cfe5eb, which changed the MSI installation scope to perMachine. There were concerns about creating the npm directory in that PR, albeit not related to security (see nodejs/node-v0.x-archive#25640). Refs: nodejs/node-v0.x-archive#8141 Refs: nodejs/node-v0.x-archive#8838 Refs: nodejs/node-v0.x-archive#25640 PR-URL: nodejs-private/node-private#408 Backport-PR-URL: nodejs-private/node-private#430 Reviewed-By: Rich Trott <[email protected]> CVE-ID: CVE-2023-30585
1 parent d6fae8e commit ab26912

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

tools/msvs/msi/product.wxs

-12
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
<ComponentRef Id="NodeRegistryEntries"/>
7777
<ComponentRef Id="NodeVarsScript"/>
7878
<ComponentRef Id="NodeStartMenu"/>
79-
<ComponentRef Id="AppData" />
8079
<ComponentRef Id="InstallToolsBat" />
8180
<ComponentRef Id="SetInstallDirPermission" />
8281
<ComponentGroupRef Id="Product.Generated"/>
@@ -107,7 +106,6 @@
107106
<ComponentRef Id="NpxCmdScript"/>
108107
<ComponentRef Id="NpxBashScript"/>
109108
<ComponentRef Id="NpmConfigurationFile"/>
110-
<ComponentRef Id="AppData" />
111109
<ComponentRef Id="SetInstallDirPermission" />
112110
<ComponentGroupRef Id="NpmSourceFiles"/>
113111
</Feature>
@@ -266,16 +264,6 @@
266264
</Component>
267265
</Directory>
268266
</Directory>
269-
270-
<Directory Id="AppDataFolder">
271-
<Directory Id="AppDataDir" Name="npm">
272-
<Component Id="AppData" Guid="D3B35D0E-D0F9-4D11-A773-D4608E90E1D1">
273-
<CreateFolder />
274-
<RemoveFolder Id="AppDataDir" On="uninstall" />
275-
<RegistryValue Root="HKCU" Key="$(var.RegistryKeyPath)\Components" Type="string" Value="" />
276-
</Component>
277-
</Directory>
278-
</Directory>
279267
</DirectoryRef>
280268

281269
<DirectoryRef Id="ApplicationProgramsFolder">

0 commit comments

Comments
 (0)