Skip to content

Unquoted executable path could lead to hijacked execution flow

Moderate
ReenigneArcher published GHSA-r3rw-mx4q-7vfp May 16, 2024

Package

sunshine

Affected versions

>= 0.17.0, < 0.23.0

Patched versions

v0.23.0

Description

Impact

Users who ran Sunshine as a service on Windows may be impacted when terminating the service if an attacker placed a file named C:\Program.exe, C:\Program.bat, or C:\Program.cmd on the user's computer. This attack vector isn't exploitable unless the user has manually loosened ACLs on the system drive.

The lpCommandLine parameter passed to CreateProcessAsUser() was initialized using the path returned from GetModuleFileName() which is not enclosed in quotes. As a result, the Microsoft documented executable search logic is used to locate the desired executable, which tries C:\Program.exe, C:\Program.bat, or C:\Program.cmd before the expected C:\Program Files\Sunshine\tools\sunshinesvc.exe file.

If the user's system locale is not English, then the name of the executable will likely vary. The executable name is based on the Program Files directory name.

Patches

v0.23.0

Workarounds

  • Identify and block potentially malicious software executed path interception by using application control tools, like Windows Defender Application Control, AppLocker, or Software Restriction Policies where appropriate.
  • Ensure that proper permissions and directory access control are set to deny users the ability to write files to the top-level directory C:. Require that all executables be placed in write-protected directories.

References

Severity

Moderate
5.8
/ 10

CVSS base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
High
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N

CVE ID

CVE-2024-31226

Weaknesses

Credits