Skip to content

Commit 41bbb11

Browse files
committed
fix: Fix critical security issue on windows MSI packaging
1 parent 9a97114 commit 41bbb11

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Changes

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ packaging:
66
* [SECURITY] Fix CVE-2024-28241: A local user could modify the GLPI-Agent installation
77
to gain higher privileges, but only when GLPI Agent is not installed in the default
88
installation folder
9+
* [SECURITY] Fix CVE-2024-28240: A local user could modify the GLPI Agent configuration
10+
to gain higher privileges
911

1012
1.7.1 Fri, 22 Dec 2023
1113

contrib/windows/packaging/MSI_main-v2.wxs.tt

+12
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,14 @@
442442
<CustomAction Id="SetFixLocalDir" Property="FixLocalDir" Value="&quot;[SystemFolder]icacls.exe&quot; &quot;[LOCAL].&quot; /inheritance:r" Execute="immediate" />
443443
<CustomAction Id="FixLocalDir" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
444444

445+
<CustomAction Id="SetCheckRunningAsAdmin" Property="WixQuietExecCmdLine" Value="&quot;[SystemFolder]net.exe&quot; file" Execute="immediate" />
446+
<CustomAction Id="CheckRunningAsAdmin" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="immediate" Return="check" Impersonate="yes" />
447+
<CustomAction Id="FatalError" Error="25000" />
448+
445449
<InstallExecuteSequence>
450+
<Custom Action="SetCheckRunningAsAdmin" Before="CheckRunningAsAdmin"><![CDATA[Installed AND (NOT REMOVE~="ALL")]]></Custom>
451+
<Custom Action="CheckRunningAsAdmin" After="LaunchConditions"><![CDATA[Installed AND (NOT REMOVE~="ALL")]]></Custom>
452+
446453
<!-- InstallExecuteSequence is used to define Custom Actions that fire after the UI is finished and the install is starting to execute -->
447454
<Custom Action="CA_SetARPInstallLoc" Before="RegisterProduct" />
448455
<Custom Action="SetDefaultLogFile" After="CostFinalize"><![CDATA[NOT LOGFILE]]></Custom>
@@ -506,6 +513,9 @@
506513
</InstallExecuteSequence>
507514

508515
<InstallUISequence>
516+
<Custom Action="SetCheckRunningAsAdmin" Before="CheckRunningAsAdmin"><![CDATA[Installed AND (NOT REMOVE~="ALL")]]></Custom>
517+
<Custom Action="CheckRunningAsAdmin" After="LaunchConditions"><![CDATA[Installed AND (NOT REMOVE~="ALL")]]></Custom>
518+
509519
<!-- InstallUISequence is used to define a dialog or Custom Action that fires in the UI sequence of events during the install -->
510520
<Custom Action="CA_GetARPInstallLoc" Before="CostInitialize"><![CDATA[UPGRADINGPRODUCTCODE AND UPGRADEDIR]]></Custom>
511521
<!-- Better set ProgressDlg to be after MigrateFeatureStates so we can safely insert SetProperties before ExecuteAction -->
@@ -523,6 +533,8 @@
523533
<UIRef Id='WixUI_Common' />
524534

525535
<UI Id="WixUI_MyInstallDlg">
536+
<Error Id="25000">Only administrators can modify [AgentName] installation</Error>
537+
526538
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
527539
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
528540
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

0 commit comments

Comments
 (0)