Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS04djI4LTNnODYtY2hqNc4AA5Ke

PanelSwWix4.Sdk .be TEMP folder is vulnerable to DLL redirection attacks that allow the attacker to escalate privileges

Summary

.be TEMP folder is vulnerable to DLL redirection attacks that allow the attacker to escalate privileges.

Details

If the bundle is not run as admin, the user's TEMP folder is used and not the system TEMP folder. A utility is able to monitor the user's TEMP folder for changes and drop its own DLL into the .be/.Local folder immediately when the .be folder is created. When the burn engine elevates, the malicious DLL receives elevated privileges.

PoC

As a standard, non-admin user:

  1. Monitor the user's TEMP folder for changes using ReadDirectoryChangesW
  2. On FILE_ACTION_ADDED, check if the folder name is .be
  3. Create a folder in .be named after the bundle + .Local (e.g. MyInstaller.exe.Local)
  4. Put the malicious COMCTL32.DLL in the .Local folder following the naming used for the real DLL (e.g. MyInstaller.exe.Local/x86_microsoft.windows.common-controls_.../COMCTL32.dll)
  5. Do hacker things when the engine escalates and the malicious DLL is loaded

Proper naming for the path can be obtained by using GetModuleHandle("comctl32.dll") and GetModuleFileName.

Impact

DLL redirection utilizing .exe.Local Windows capability. This impacts any installer built with the WiX installer framework.

Permalink: https://github.com/advisories/GHSA-8v28-3g86-chj5
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS04djI4LTNnODYtY2hqNc4AA5Ke
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 10 months ago
Updated: 10 months ago


CVSS Score: 8.3
CVSS vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Identifiers: GHSA-8v28-3g86-chj5
References: Repository: https://github.com/nirbar/wix4
Blast Radius: 1.0

Affected Packages

nuget:PanelSwWix4.Sdk
Affected Version Ranges: < 5.0.0-psw-wix.0251-40
Fixed in: 5.0.0-psw-wix.0251-40