aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/bootstrapperapplication.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2024-03-20 23:51:53 -0700
committerRob Mensching <rob@firegiant.com>2024-03-22 11:57:27 -0700
commitfed3d69eb4da7fa2bafdd8f555ce5869c36925f7 (patch)
treecb9bd56e7a36f118da7ad44107018b86a30fbdae /src/burn/engine/bootstrapperapplication.cpp
parente84b6768772c01e44dd55fb583cf78388ec7e48a (diff)
downloadwix-fed3d69eb4da7fa2bafdd8f555ce5869c36925f7.tar.gz
wix-fed3d69eb4da7fa2bafdd8f555ce5869c36925f7.tar.bz2
wix-fed3d69eb4da7fa2bafdd8f555ce5869c36925f7.zip
Protect elevated working folder from malicious data
When running elevated, Burn uses the Windows Temp folder as its working folder to prevent normal processes from tampering with the files. Windows Temp does allow non-elevated processes to write to the folder but they cannot see the files there. Unfortunately, contrary to our belief, non-elevated processes can read the files in Windows Temp by watching for directory changes. This allows a malicious process to lie in wait, watching the Windows Temp folder until a Burn process is launched elevated, then attack the working folder. Mitigate that attack by protecting the working folder to only elevated users. Managed custom actions also fall back to using the Windows Temp folder in some cases and thus can be exposed in a similar fashion as an elevated Burn process. Remove that possibility.
Diffstat (limited to '')
-rw-r--r--src/burn/engine/bootstrapperapplication.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/burn/engine/bootstrapperapplication.cpp b/src/burn/engine/bootstrapperapplication.cpp
index 402f7015..947b3720 100644
--- a/src/burn/engine/bootstrapperapplication.cpp
+++ b/src/burn/engine/bootstrapperapplication.cpp
@@ -276,6 +276,7 @@ EXTERN_C HRESULT BootstrapperApplicationInterpretExecuteResult(
276} 276}
277 277
278EXTERN_C HRESULT BootstrapperApplicationEnsureWorkingFolder( 278EXTERN_C HRESULT BootstrapperApplicationEnsureWorkingFolder(
279 __in BOOL fElevated,
279 __in BURN_CACHE* pCache, 280 __in BURN_CACHE* pCache,
280 __deref_out_z LPWSTR* psczUserExperienceWorkingFolder 281 __deref_out_z LPWSTR* psczUserExperienceWorkingFolder
281 ) 282 )
@@ -283,7 +284,7 @@ EXTERN_C HRESULT BootstrapperApplicationEnsureWorkingFolder(
283 HRESULT hr = S_OK; 284 HRESULT hr = S_OK;
284 LPWSTR sczWorkingFolder = NULL; 285 LPWSTR sczWorkingFolder = NULL;
285 286
286 hr = CacheEnsureBaseWorkingFolder(pCache, &sczWorkingFolder); 287 hr = CacheEnsureBaseWorkingFolder(fElevated, pCache, &sczWorkingFolder);
287 ExitOnFailure(hr, "Failed to create working folder."); 288 ExitOnFailure(hr, "Failed to create working folder.");
288 289
289 hr = StrAllocFormatted(psczUserExperienceWorkingFolder, L"%ls%ls\\", sczWorkingFolder, L".ba"); 290 hr = StrAllocFormatted(psczUserExperienceWorkingFolder, L"%ls%ls\\", sczWorkingFolder, L".ba");