Skip to content

Unquoted Service Path in SunshineService Allows Local SYSTEM Code Execution

Moderate
ReenigneArcher published GHSA-6p7j-5v8v-w45h Sep 23, 2025

Package

Sunshine (Windows)

Affected versions

>=v0.10.0, <=v2025.628.4510

Patched versions

v2025.923.33222

Description

Overview

An insecure service configuration was identified in Sunshine for Windows. The Windows service SunshineService is installed with an unquoted executable path. If Sunshine is installed in a directory whose name includes a space, the Service Control Manager (SCM) interprets the path incrementally and may execute a malicious binary placed earlier in the search string. The condition corresponds to CWE-428: Unquoted Search Path or Element and allows a local attacker with write access to the chosen directory prefix (for example C:\Program\) to execute arbitrary code with NT AUTHORITY\SYSTEM privileges when the service starts.

Vulnerability Details

Technical Description

During installation, the Sunshine setup registers a Windows service named SunshineService. The BINARY_PATH_NAME for this service, which points to sunshinesvc.exe, is stored in the Windows Registry without being enclosed in quotation marks.

When the Service Control Manager attempts to start a service with an unquoted path containing spaces, it interprets the path token by token. For example, with a path like C:\Program\Game Stream\Sunshine\tools\sunshinesvc.exe, the SCM first probes C:\Program\Game.exe before C:\Program\Game Stream\Sunshine\tools\sunshinesvc.exe.

If a low-privilege user can create C:\Program\Game.exe, when the SunshineService is started, the Service Control Manager will execute the attacker's file with the privileges of the service, which is NT AUTHORITY\SYSTEM.

While the default installation path (C:\Program Files\Sunshine) is generally safe because standard users cannot write to the root of C:\ directory (thus, they cannot create a rogue Program.exe at that location), this vulnerability becomes exploitable if Sunshine is installed into a custom location with spaces in its path such as C:\Program\Game Stream\Sunshine, located within a directory that a regular user have write permissions for.

Proof of Concept (PoC)

The following steps demonstrate the vulnerability by installing Sunshine to C:\Program\Game Stream\Sunshine.

Step 1: Installation in a Vulnerable Path
During setup, a custom installation path of C:\Program\Game Stream\Sunshine is chosen.
image

Step 2: Confirming the Unquoted Service Path
After installation, Process Monitor shows that the installer writes the unquoted path to the registry for the SunshineService.
image

Running the command sc.exe qc SunshineService in a command prompt confirms that the BINARY_PATH_NAME is indeed unquoted.
image

Step 3: Observing the Vulnerable Behavior
When the SunshineService is started, we can observe the path-parsing logic in action. Process Monitor captures services.exe attempting to find and execute C:\Program\Game.exe, which results in a NAME NOT FOUND error. This occurs before it correctly locates the legitimate sunshinesvc.exe, confirming the vulnerable logic.
image

Step 4: Placing the Malicious Executable
A malicious executable is created, named Game.exe, and placed in the C:\Program\ directory.
image

Step 5: Exploitation
Launch Sunshine, or restart the SunshineService. As the service starts up, the operating system's parser again follows the logic from Step 3. This time, it finds the malicious C:\Program\Game.exe and executes it with LocalSystem privileges.
Process Monitor confirms that services.exe successfully launches C:\Program\Game.exe.
image

Impact

Successful exploitation of this vulnerability allows a local, low-privileged user who can write to directory path segment that precedes the first space in the unquoted string to execute arbitrary code as SYSTEM permissions. This leads to a privilege escalation, granting the attacker control over the compromised system. An attacker could use this to install persistent malware, steal sensitive data, or disable security controls.

It is recommended to enclose the BINARY_PATH_NAME for the SunshineService in quotation marks during installation to remediate this vulnerability.

Note: The default installation path (C:\Program Files\Sunshine) is rarely exploitable, because standard users cannot write to the root of C: on modern Windows. The risk materialises when:

  • An administrator selects a different installation folder that contains a space (e.g. C:\\Program\\Game Stream\\Sunshine), or
  • Sunshine is installed to a secondary drive or share with weaker ACLs, or
  • The system root’s ACLs are relaxed.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
High
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2025-54081

Weaknesses

Unquoted Search Path or Element

The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path. Learn more on MITRE.

Credits