GHSA-wq88-fq4x-h2pm

Suggest an improvement
Source
https://github.com/advisories/GHSA-wq88-fq4x-h2pm
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/03/GHSA-wq88-fq4x-h2pm/GHSA-wq88-fq4x-h2pm.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-wq88-fq4x-h2pm
Published
2024-03-25T19:35:53Z
Modified
2024-12-05T05:34:30.717200Z
Severity
  • 7.3 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H CVSS Calculator
Summary
WiX Burn-based bundles are vulnerable to binary hijack when run as SYSTEM
Details

Summary

Burn uses an unprotected C:\Windows\Temp directory to copy binaries and run them from there. This directory is not entirely protected against low privilege users.

Details

When a bundle runs as SYSTEM user, Burn uses GetTempPathW which points to an insecure directory C:\Windows\Temp to drop and load multiple binaries. Standard users can hijack the binary before it's loaded in the application resulting in elevation of privileges.

icacls c:\windows\temp

BUILTIN\Users:(CI)(S,WD,AD,X)
BUILTIN\Administrators:(F)
BUILTIN\Administrators:(OI)(CI)(IO)(F)
NT AUTHORITY\SYSTEM:(F)
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)(F)
CREATOR OWNER:(OI)(CI)(IO)(F)

Built in users(non-administrators) have special permissions to this folder and can create files and write to this directory. While they do not have explicit read permissions, there is a way they can monitor the changes to this directory using ReadDirectoryChangesW API and thus figure out randomized folder names created inside this directory as wel

PoC

PoC works against the against visual studio enterprise with update 3 installer

Reproduction steps

As a standard user, run the poc. Mount the iso and run visual studio installer as local system account. The PoC should hijack the the binaries dropped by vs installer and a child process "notepad.exe" will be running.

Impact

This is an Elevation of Privilege Vulnerability where a low privileged user can hijack binaries in an unprotected path C:\Windows\Temp to elevate to the SYSTEM user privileges.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2024-03-25T19:35:53Z"
}
References

Affected packages

NuGet / PanelSW.Custom.WiX

Package

Name
PanelSW.Custom.WiX
View open source insights on deps.dev
Purl
pkg:nuget/PanelSW.Custom.WiX

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.15.0-a46

Affected versions

3.*

3.12.0-b100
3.12.0-b45
3.12.0-b48
3.12.0-b53
3.12.0-b57
3.12.0-b59
3.12.0-b60
3.12.0-b69
3.12.0-b82
3.12.0-b83
3.12.0-b84
3.12.0-b85
3.12.0-b86
3.12.0-b88
3.12.0-b89
3.12.0-b91
3.12.0-b92
3.12.0-b93
3.12.0-b99
3.12.0-c101
3.12.0-c104
3.12.0-c105
3.12.0-c106
3.12.0-c107
3.12.0-c108
3.12.0-c110
3.12.0-c111
3.12.0-c112
3.12.0-c113
3.12.0-c114
3.12.0-c115
3.12.0-c116
3.12.0-c117
3.12.0-c121
3.12.0-c123
3.12.0-c124
3.12.0-c126
3.12.0-c127
3.12.0-c129
3.12.0-c130
3.12.0-c135
3.12.0-c150
3.12.0-c156
3.12.0-c158
3.12.0-c161
3.12.0-c162
3.12.0-c165
3.12.0-c166
3.12.0-c167
3.12.0-c176
3.12.0-c177
3.12.0-c182
3.12.0-c183
3.12.0-c185
3.12.0-c186
3.12.0-c187
3.12.0-c188
3.12.0-c189
3.12.0-c190
3.12.0-c193
3.12.0-c194
3.15.0-a44
3.15.0-a45

Database specific

{
    "last_known_affected_version_range": "<= 3.15.0-a45"
}