Skip to content
File upload Disclosed report Advanced

Arbitrary File Write as SYSTEM from unprivileged user

b0yd Follow

Originally disclosed on HackerOne

Bounty$1,250 High 7.8 View original
  • Paid in 8 months
  • Disclosed after 8 months

Summary by the program

Note: This report was reviewed and updated after a correction to program scope.

Vulnerability

The Steam Client installs a "Steam Client Service" that runs as SYSTEM to update the steam application. This service executes from C:\Program Files (x86)\Common\Steam where permissions are properly set to only allow modification from SYSTEM or the Administrators group.

If the service encounters an error, it writes to the log file C:\Program Files (x86)\Steam\logs\service_log.txt. This is a problem because this particular folder, and the parent folder, have permissions set to "Full Control" to any unprivileged user. A regular user can also trigger an error when the service starts by modifying or deleting the "C:\Program Files (x86)\Steam\bin\steamservice.dll" file that an unprivileged user also has "Full Control" of.

It also just so happens that the permissions for the "Steam Client Service" allow for starting and stopping by unprivileged users, which facilitates for easy triggering of the exploit.

To exploit this vulnerability, an unprivileged user can create a symlink between the "C:\Program Files (x86)\Steam\logs\service_log.txt" file and any destination file that SYSTEM can write to. Next they would modify, move, or delete the "C:\Program Files (x86)\Steam\bin\steamservice.dll" to trigger an error message to be written. Finally they would start the "Steam Client Service" service to force the file write. The following video demonstrates writing to C:\Windows\System32\evil.dll and also C:\Windows\System32\drivers\pci.sys to break the box.

Fix

The primary fix for this vulnerability would be to move the log file for the "Steam Client Service" to a directory with proper permissions set, C:\Program Files (x86)\Common\Steam, would be a viable option. If the service is making any other privileged writes in the C:\Program Files (x86)\Steam folder, they would need to be addressed as well.

References

https://offsec.provadys.com/intro-to-file-operation-abuse-on-Windows.html

Impact

A unprivileged user can write to any file on the file system with SYSTEM privileges.

The original report as published on HackerOne, by b0yd. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

The target is the Steam Client on Windows. The client installs a component called the "Steam Client Service", which runs as SYSTEM and exists to update the Steam application. The service executes from C:\Program Files (x86)\Common\Steam, a directory whose permissions are set correctly: only SYSTEM and the Administrators group can modify it.

The service writes a log file, C:\Program Files (x86)\Steam\logs\service_log.txt, when it encounters an error. That log path is the interesting part, because the folder it sits in, and its parent folder, grant "Full Control" to any unprivileged user.

The report was reviewed and updated after a correction to the program scope.

Setup

The preconditions are all local to a Windows machine with the Steam Client installed:

  1. A regular, unprivileged user account on the host.
  2. The Steam Client installed, giving the "Steam Client Service" running as SYSTEM.
  3. Write access to C:\Program Files (x86)\Steam\logs\ and its parent, which the default permissions already provide to any unprivileged user.
  4. Write access to C:\Program Files (x86)\Steam\bin\steamservice.dll, which is likewise under "Full Control" for unprivileged users.
  5. The ability to start and stop the "Steam Client Service", which the service permissions also allow for unprivileged users.
  6. A way to create symbolic links as an unprivileged user. The report points to Google Project Zero's symboliclink-testing-tools, specifically the CreateSymlink utility.

No credentials, network position or remote access are needed: everything happens from the local unprivileged session.

Finding it

The researcher looked at where the SYSTEM service writes and compared that with who can write there. The service itself is protected: C:\Program Files (x86)\Common\Steam only allows modification by SYSTEM or Administrators. But its error log is written to C:\Program Files (x86)\Steam\logs\service_log.txt, and that folder, together with its parent, is set to "Full Control" for any unprivileged user.

That mismatch is the bug: a privileged process writes into a directory an unprivileged user controls. The same applies to C:\Program Files (x86)\Steam\bin\steamservice.dll, which an unprivileged user also has "Full Control" over, and which an unprivileged user also has "Full Control" over. Modifying, moving or deleting that DLL makes the service fail on start, which is exactly the condition that produces the log write.

Finally, the service permissions allow unprivileged users to start and stop the "Steam Client Service", so the trigger can be pulled at will rather than waiting for a natural error.

Exploitation

The chain combines three primitives: a privileged write to an attacker-chosen path (via a symlink), a reliable way to make the service error, and the right to start the service.

Step 1: Create a symlink from the log file to the target

An unprivileged user creates a symlink between C:\Program Files (x86)\Steam\logs\service_log.txt and any destination file that SYSTEM can write to. The CreateSymlink tool from symboliclink-testing-tools is the utility the report names for this. The effect is that when the service opens its log path for writing, the write is redirected to the destination file with SYSTEM's privileges.

Step 2: Trigger an error in the service

Modify, move or delete C:\Program Files (x86)\Steam\bin\steamservice.dll. The change makes the service fail, and the failure is what causes the error message to be written to the log path, which is now the symlink.

Step 3: Start the service to force the write

Start the "Steam Client Service". Because unprivileged users are allowed to start and stop it, this needs no elevation. The service starts, hits the error, and writes its log entry through the symlink, landing in the destination file as SYSTEM.

The report's demonstration writes to C:\Windows\System32\evil.dll and also to C:\Windows\System32\drivers\pci.sys to break the box. The report says writing these files was used to break the box.

Root cause

The design mistake is a privileged writer targeting a path inside a directory writable by unprivileged users. The service runs as SYSTEM and logs to C:\Program Files (x86)\Steam\logs\service_log.txt, while that folder and its parent grant "Full Control" to any unprivileged user. The service's own directory, C:\Program Files (x86)\Common\Steam, is locked down correctly, so the protection exists but is applied to the wrong location relative to where the writes happen.

Two further conditions make the bug practical rather than theoretical. Unprivileged users can also modify C:\Program Files (x86)\Steam\bin\steamservice.dll, giving a way to force the error that produces the log write. And the service permissions allow unprivileged users to start and stop it, so the trigger is under the attacker's control.

Existing defences did not stop it because the write is performed by the privileged service itself; the attacker never needs to write to the protected destination directly. The symlink redirects the service's own write, so the file system permissions on the destination are satisfied by the SYSTEM token.

Impact

An unprivileged user can write to any file on the file system with SYSTEM privileges. That is local privilege escalation: from a regular user account, arbitrary files owned by SYSTEM can be created or overwritten, including system binaries and drivers. The report's demonstration writes to C:\Windows\System32\evil.dll and C:\Windows\System32\drivers\pci.sys to break the box.

The impact is bounded by the local nature of the attack: the attacker must already have an unprivileged session on the machine with the Steam Client installed. The program rated it high severity with a CVSS score of 7.8, classified as privilege escalation, and paid a bounty of 1,250 USD.

Fix

The primary fix is to move the log file for the "Steam Client Service" to a directory with proper permissions. The report names C:\Program Files (x86)\Common\Steam as a viable option, since that directory is already restricted to SYSTEM and Administrators. The report also notes that if the service makes any other privileged writes inside C:\Program Files (x86)\Steam, those would need to be addressed as well. The report describes the recommended fix; it does not state which change was actually shipped.

Variants to test

  1. Other privileged log paths. Look for services running as SYSTEM that write logs, crash dumps or temporary files into user-writable directories. A positive result is a log path under a folder where your unprivileged account has write access.
  2. Loaded modules in user-writable directories. Check whether a privileged service loads DLLs from paths an unprivileged user can modify, as with steamservice.dll. A positive result is a service that fails (and logs) when you rename or delete such a file.
  3. Service control permissions. Enumerate services whose start and stop rights are granted to unprivileged users. A positive result is being able to cycle a SYSTEM service without elevation, which gives you a repeatable trigger.
  4. Symlink redirection of the write. For each candidate privileged write, create a symlink from the writable path to a SYSTEM-only destination and trigger the write. A positive result is the destination file being created or modified with SYSTEM ownership.
  5. Other privileged write operations. The report's reference on file operation abuse covers more than logging; test copy, move, delete and rename operations performed by privileged components against user-writable paths in the same way.

Hunting notes

This class of bug hides where a privileged component and an unprivileged user share a directory. During recon on a Windows host, the signals are: services running as SYSTEM, their binary and working directories, and the ACLs on every path they touch. Compare the ACL of the service's install directory with the ACL of its log, cache, temp and update directories; a protected install directory next to a "Full Control" log directory is the pattern seen here. Also check the ACLs on files the service loads, and the service control permissions, since both turn a theoretical write into a reliable exploit.

: a symlink from the log file, a forced error via the DLL, a service start, and a write landing in C:\Windows\System32\evil.dll and C:\Windows\System32\drivers\pci.sys.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

Steam is a program for buying and playing games on a computer. When you install it on Windows, it also installs a small helper program called the "Steam Client Service". This helper runs with the highest level of permission on the machine, a level called SYSTEM, so that it can update Steam without asking you for an administrator password every time.

On Windows, every file and folder has a list of who is allowed to do what with it. That list is called permissions, or an ACL. Normally, the folder where this helper lives is locked down so that only SYSTEM and the Administrators group can change anything inside it. That is the correct setup.

The problem is what the helper does when something goes wrong: it writes a note about the error into a log file. A log file is just a text file where a program records what it did and what failed, a bit like a diary. The helper writes its diary entry to C:\Program Files (x86)\Steam\logs\service_log.txt. That folder, and the folder above it, are set to "Full Control" for any ordinary user. Full Control means you can read, change, create and delete anything in there.

So we have a powerful program writing into a folder that an ordinary user controls. That is the seed of the whole bug. An ordinary user can also change a file the helper depends on, C:\Program Files (x86)\Steam\bin\steamservice.dll, which makes the helper fail and therefore write its diary entry. And ordinary users are allowed to start and stop the helper service themselves.

Put together, an ordinary user can point the diary entry at any file on the computer, make the helper fail, start the helper, and have the powerful helper write to that file for them. The researcher demonstrated this by writing to C:\Windows\System32\evil.dll and to C:\Windows\System32\drivers\pci.sys, the second of which is enough to break the machine.

The report was reviewed and updated after a correction to the program scope. The program rated it high severity with a CVSS score of 7.8, classified it as privilege escalation, and paid a bounty of 1,250 USD.

Context

The target is the Steam Client on Windows. The client installs a component called the "Steam Client Service", which runs as SYSTEM and exists to update the Steam application. The service executes from C:\Program Files (x86)\Common\Steam, a directory whose permissions are set correctly: only SYSTEM and the Administrators group can modify it.

A few terms first, because the rest of the article leans on them.

  • Service: a program that runs in the background, usually starts with the computer, and is not tied to a window you can see. Think of a building's boiler room: you do not visit it, but it keeps the building warm.
  • SYSTEM: the most powerful account on a Windows machine. It is not a person; it is the account the operating system itself uses. Anything running as SYSTEM can read, change or delete essentially any file. Compare it to the master key that opens every door in the building.
  • Permissions / ACL: the list attached to every file and folder saying which users and groups may read, write, or fully control it. "Full Control" is the widest setting on that list.
  • Administrators group: the group of accounts allowed to make system-wide changes. A normal user is not in it.

The service writes a log file, C:\Program Files (x86)\Steam\logs\service_log.txt, when it encounters an error. That log path is the interesting part, because the folder it sits in, and its parent folder, grant "Full Control" to any unprivileged user.

Setup

The preconditions are all local to a Windows machine with the Steam Client installed:

  1. A regular, unprivileged user account on the host.
  2. The Steam Client installed, giving the "Steam Client Service" running as SYSTEM.
  3. Write access to C:\Program Files (x86)\Steam\logs\ and its parent, which the default permissions already provide to any unprivileged user.
  4. Write access to C:\Program Files (x86)\Steam\bin\steamservice.dll, which is likewise under "Full Control" for unprivileged users.
  5. The ability to start and stop the "Steam Client Service", which the service permissions also allow for unprivileged users.
  6. A way to create symbolic links as an unprivileged user. The report points to Google Project Zero's symboliclink-testing-tools, specifically the CreateSymlink utility.

A symbolic link (symlink) is a shortcut that the operating system treats as if it were the real file. If you open the shortcut, you get the file it points to. If a program writes to the shortcut, the write lands in the file it points to. Think of a forwarding address on a letter: the post office delivers to wherever the note says, not to the envelope in your hand.

No credentials, network position or remote access are needed: everything happens from the local unprivileged session. In other words, the attacker is already sitting at the keyboard as a normal user, and does not need to break in from outside.

Finding it

The researcher looked at where the SYSTEM service writes and compared that with who can write there. The service itself is protected: C:\Program Files (x86)\Common\Steam only allows modification by SYSTEM or Administrators. But its error log is written to C:\Program Files (x86)\Steam\logs\service_log.txt, and that folder, together with its parent, is set to "Full Control" for any unprivileged user.

That mismatch is the bug: a privileged process writes into a directory an unprivileged user controls. The same applies to C:\Program Files (x86)\Steam\bin\steamservice.dll, which an unprivileged user also has "Full Control" over, and which an unprivileged user also has "Full Control" over. Modifying, moving or deleting that DLL makes the service fail on start, which is exactly the condition that produces the log write.

A DLL is a file containing code that other programs load and use, like a shared toolbox. If the toolbox is missing or broken, the program that needs it cannot start properly.

Finally, the service permissions allow unprivileged users to start and stop the "Steam Client Service", so the trigger can be pulled at will rather than waiting for a natural error. That matters because an attacker wants to decide when the bug fires, not hope for a lucky crash.

Exploitation

The chain combines three primitives: a privileged write to an attacker-chosen path (via a symlink), a reliable way to make the service error, and the right to start the service. A primitive here means a small, simple capability that on its own is not enough, but which can be combined with others into a full attack.

Step 1: Create a symlink from the log file to the target

An unprivileged user creates a symlink between C:\Program Files (x86)\Steam\logs\service_log.txt and any destination file that SYSTEM can write to. The CreateSymlink tool from symboliclink-testing-tools is the utility the report names for this. The effect is that when the service opens its log path for writing, the write is redirected to the destination file with SYSTEM's privileges.

Why this step: the attacker cannot write to a SYSTEM-only file directly, because the permissions on that file refuse them. But the service can. By replacing the log file with a forwarding address, the attacker borrows the service's permission for the write.

Step 2: Trigger an error in the service

Modify, move or delete C:\Program Files (x86)\Steam\bin\steamservice.dll. The change makes the service fail, and the failure is what causes the error message to be written to the log path, which is now the symlink.

Why this step: the log write only happens when there is an error to record. Breaking the DLL is a dependable way to create that error on demand, instead of waiting for something to go wrong by itself.

Step 3: Start the service to force the write

Start the "Steam Client Service". Because unprivileged users are allowed to start and stop it, this needs no elevation. The service starts, hits the error, and writes its log entry through the symlink, landing in the destination file as SYSTEM.

Why this step: starting the service is what makes it run, hit the broken DLL, and perform the write. Because the start permission is open to ordinary users, the attacker can do this without an administrator password.

The report's demonstration writes to C:\Windows\System32\evil.dll and also to C:\Windows\System32\drivers\pci.sys to break the box. The report says writing these files was used to break the box. "Break the box" is informal for crashing or disabling the machine.

Root cause

The design mistake is a privileged writer targeting a path inside a directory writable by unprivileged users. The service runs as SYSTEM and logs to C:\Program Files (x86)\Steam\logs\service_log.txt, while that folder and its parent grant "Full Control" to any unprivileged user. The service's own directory, C:\Program Files (x86)\Common\Steam, is locked down correctly, so the protection exists but is applied to the wrong location relative to where the writes happen.

Two further conditions make the bug practical rather than theoretical. Unprivileged users can also modify C:\Program Files (x86)\Steam\bin\steamservice.dll, giving a way to force the error that produces the log write. And the service permissions allow unprivileged users to start and stop it, so the trigger is under the attacker's control.

Existing defences did not stop it because the write is performed by the privileged service itself; the attacker never needs to write to the protected destination directly. The symlink redirects the service's own write, so the file system permissions on the destination are satisfied by the SYSTEM token. A token in this sense is the internal record of who a running program is acting as; the service's token says SYSTEM, so the file system lets the write through.

Impact

An unprivileged user can write to any file on the file system with SYSTEM privileges. That is local privilege escalation: from a regular user account, arbitrary files owned by SYSTEM can be created or overwritten, including system binaries and drivers. The report's demonstration writes to C:\Windows\System32\evil.dll and C:\Windows\System32\drivers\pci.sys to break the box.

Privilege escalation means moving from a lower level of permission to a higher one. Here the attacker starts as an ordinary user and ends up able to write files as SYSTEM, which is the top of the ladder.

The impact is bounded by the local nature of the attack: the attacker must already have an unprivileged session on the machine with the Steam Client installed. The program rated it high severity with a CVSS score of 7.8, classified as privilege escalation, and paid a bounty of 1,250 USD. CVSS is a standard scoring system for how serious a vulnerability is; 7.8 is in the high range.

Fix

The primary fix is to move the log file for the "Steam Client Service" to a directory with proper permissions. The report names C:\Program Files (x86)\Common\Steam as a viable option, since that directory is already restricted to SYSTEM and Administrators. The report also notes that if the service makes any other privileged writes inside C:\Program Files (x86)\Steam, those would need to be addressed as well. The report describes the recommended fix; it does not state which change was actually shipped.

In plain terms: put the diary in a locked room, not in the corridor everyone can walk through.

Variants to test

  1. Other privileged log paths. Look for services running as SYSTEM that write logs, crash dumps or temporary files into user-writable directories. A positive result is a log path under a folder where your unprivileged account has write access.
  2. Loaded modules in user-writable directories. Check whether a privileged service loads DLLs from paths an unprivileged user can modify, as with steamservice.dll. A positive result is a service that fails (and logs) when you rename or delete such a file.
  3. Service control permissions. Enumerate services whose start and stop rights are granted to unprivileged users. A positive result is being able to cycle a SYSTEM service without elevation, which gives you a repeatable trigger.
  4. Symlink redirection of the write. For each candidate privileged write, create a symlink from the writable path to a SYSTEM-only destination and trigger the write. A positive result is the destination file being created or modified with SYSTEM ownership.
  5. Other privileged write operations. The report's reference on file operation abuse covers more than logging; test copy, move, delete and rename operations performed by privileged components against user-writable paths in the same way.

Hunting notes

This class of bug hides where a privileged component and an unprivileged user share a directory. During recon on a Windows host, the signals are: services running as SYSTEM, their binary and working directories, and the ACLs on every path they touch. Compare the ACL of the service's install directory with the ACL of its log, cache, temp and update directories; a protected install directory next to a "Full Control" log directory is the pattern seen here. Also check the ACLs on files the service loads, and the service control permissions, since both turn a theoretical write into a reliable exploit.

: a symlink from the log file, a forced error via the DLL, a service start, and a write landing in C:\Windows\System32\evil.dll and C:\Windows\System32\drivers\pci.sys.

Glossary

  • ACL: the list attached to a file or folder saying which users and groups may read, write or fully control it.
  • Administrators group: the group of Windows accounts allowed to make system-wide changes.
  • Bounty: a payment a company makes to someone who reports a valid security bug.
  • CVSS: a standard scoring system for the severity of a vulnerability; higher numbers mean more serious.
  • DLL: a file of shared code that other programs load and use at runtime.
  • Driver: software that lets the operating system talk to hardware; a broken driver can crash the machine.
  • Full Control: the widest permission setting, allowing reading, writing, creating and deleting.
  • Local privilege escalation: gaining higher permissions starting from an ordinary account on the same machine.
  • Log file: a text file where a program records what it did and what went wrong.
  • Permissions: the rules on a file or folder about who may do what with it.
  • Primitive: a small capability that is not enough alone but can be combined into a full attack.
  • Recon: the information-gathering phase before an attack, looking at what is installed and how it is configured.
  • Service: a background program that runs without a visible window, often as SYSTEM.
  • Severity: how serious a vulnerability is judged to be, often expressed with a CVSS score.
  • Symlink (symbolic link): a shortcut the operating system treats as the real file, so writes to it land in the file it points to.
  • SYSTEM: the most powerful Windows account, used by the operating system itself.
  • Token: the internal record of which account a running program is acting as.
  • Unprivileged user: an ordinary account without administrator rights.
  • Vulnerability: a weakness in software that lets someone make it behave in a way its makers did not intend.

More by b0yd

View all

3 more disclosed reports, best first.

More from Valve

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.