Skip to content
RCE Write-up Advanced

Galactical Bug Hunting: How we discovered new issues in CD Projekt Red’s Gaming Platform

The GOG Galaxy client and its privileged service both write log files into a directory writable by all users, allowing an attacker to redirect the service's log writes to overwrite critical system files and cause a denial of service. Additionally, the service's IPC command to fix directory privileges can be abused via DLL injection to grant full access to the installation directory, enabling DLL hijacking and privilege escalation to SYSTEM.

Lautaro Fain Follow

Published on anvilsecure.com

The original analysis was started by myself, as part of a broader on-going research project, resulting in CVE-2023-50915. Later on, my colleague Alex Popovici joined me to evaluate if the vulnerability could be exploited beyond a DoS, and helped discover CVE-2023-50914 along the way.

Anvil Secure, on anvilsecure.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the privileged service writes log files into a world-writable directory and accepts IPC commands that grant broad permissions without proper validation, allowing file redirection and DLL hijacking.

Impact

An attacker could cause a denial of service by corrupting a critical driver, and could escalate privileges to SYSTEM by hijacking a DLL loaded by the privileged service.

What the attacker needed

Local user access; ability to write to the logs directory; ability to inject a DLL into the client process

How it was found

  1. Delete the logs directory and recreate it as a symbolic link pointing to a critical system driver.
  2. Trigger the privileged service to write its log, causing the driver to be overwritten and the system to crash.
  3. Inject a custom DLL into the client process to hook the function that sends the FixDirectoryPrivileges command.
  4. Modify the directory parameter to point to the GOG Galaxy installation directory.
  5. Send the command so the service grants Everyone full access to the installation directory.
  6. Place a malicious profapi.dll in the installation directory, which the service loads, spawning a SYSTEM shell.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

GOG Galaxy is a game launcher that runs two programs: one with normal user rights and one with full system rights. The full-rights program writes log files into a folder that any user can change, so an attacker can trick it into overwriting important system files. Also, the full-rights program can be made to give everyone full access to its own installation folder, letting an attacker replace a file it loads and take over the computer.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.