Counter-Strike 2: Remote Code Execution in the Game Client via svc_PacketEntities
The operator of a game server executes code in the cs2.exe process of every client that joins the server, with a single 238-byte entity update.
Advisory ID: TP-2026-170
Product: Counter-Strike 2 (multiplayer shooter by Valve on the Source 2 engine, module engine2.dll)
Vulnerability type: Out-of-bounds write (CWE-787)
Further weaknesses: write-what-where (CWE-123), unchecked array index (CWE-129)
CVE: not requested
CVSS 4.0: 9.4 (Critical) · CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Vendor report: HackerOne #4082453 (Valve)
Affected versions: 1.41.8.5 to 1.41.9.0 (measured, Windows)
Fixed in: 1.41.9.1 (ClientVersion 2000933)
Reported: 3 October 2026
Summary
Counter-Strike 2 is a multiplayer shooter by Valve on the Source 2 engine. The client processes the network message svc_PacketEntities (ID 55) 64 times per second, and only the server may send it. Its entity_data field ends with an index list of accumulated deltas, and the decoder in engine2.dll sets one bit per index in a bit field on the stack without checking the index against the upper limit of 16384 entities. The operator of a game server sets arbitrary bits within ±256 MiB of the write base and redirects a saved callback. A static 238-byte payload in a single entity update starts cmd.exe as a child process of cs2.exe, in 7 of 7 sessions and without any information leak from the target machine.
Root cause
Offsets refer to engine2.dll from build 1.41.8.8 (SHA1 27f615363f6130ebee8ff5fb4584180be377f690); no source code was available: the decoder reads the number of list elements with ReadUBitVar and the only check in the whole path is that the count is greater than zero (engine2.dll+0x8caf1).
Every further ReadUBitVar delta is added to the running index without a bound (engine2.dll+0x8cbe3), and the index is then sign-extended and shifted arithmetically (engine2.dll+0x8cbeb, engine2.dll+0x8cbf1).
The instruction or dword ptr [r15+rdx*4+0xe0], eax writes the bit into an object in the handler's stack frame (engine2.dll+0x8cbfa), within reach of nine saved return addresses and of the profiling callback in [rsp+0x50], which the function calls on every path with call r14 (engine2.dll+0x8cc55).
The same function compares against 0x4000, that is MAX_NETWORKABLE_ENTITY_COUNT, at a sibling site (engine2.dll+0x8c85b), and the module contains this bound at 28 sites.
engine2.dll carries no Control Flow Guard table and no stack cookie in the path 0x8b400 to 0x8cc80, and the dbghelp.dll from 2010 shipped with the game (game\bin\win64\dbghelp.dll) lacks HIGH_ENTROPY_VA and sat at 0x7fff0000 in 11 of 11 client starts.
Proof of Concept
The server changes three things in an update it would send anyway:
svc_PacketEntities (network message 55, server -> client)
field 2 updated_entries = 0
field 19 absent (Tag 9a 01 -> a2 06)
field 7 entity_data = UBitVar(count) UBitVar(Delta_1) ... UBitVar(Delta_n)
Index = -1 + sum(Delta_1..k) ; no upper bound
target = base + 4 * (Index >> 5) ; Bit (Index & 31) is set
Calibration: entity_data = 0c 10 00 00 -> Delta 4096, Index 4095, dword 127, bit 31
Nine bits in the callback slot turn tier0+0x86a0 into tier0+0xbffd, a gadget that moves rsp by 1040 bytes into previously zeroed stack memory; both offsets are below 0x10000, so the module base is never needed. The same primitive places a ROP chain there, built from gadgets in dbghelp.dll, which loads kernel32.dll through a helper function inside that module, resolves WinExec and calls WinExec("cmd"). The whole chain takes 238 bytes in field 7; on 1.41.9.1 the new bound (0x3fff - index, unsigned compare) ends the loop before the first write.
Impact
- Code execution in the
cs2.exeprocess with all rights of the logged-in user; the client runs without a sandbox. - The victim's only action is joining a community server (server browser,
steam://connect,connect <ip>); the server rewrites every outgoing update and attacks every joining client. - Server to client only: other players may not send network message 55, and matchmaking on Valve servers is not an entry point.
- Measured in our own lab with a client started with
-insecureand on one Windows machine; a run against a server registered with Steam and thedbghelpbase on other Windows installations are untested.
References
Is Something Like This in Your Software?
Our team found this vulnerability during its work. Have your applications tested by the same specialists, with a penetration test from turingpoint.
