
11.1 OVERVIEW
There are two vulnerabilities in CryEngine 3 due to improper handling of frag-
mented packets via CryEngine. For more information about fragmented packet is-
sues, please refer to the authors’ presentation slides27.
11.2 HEAP OVERFLOW VIA FRAGMENTED PACKETS
There is a heap overflow vulnerability, which can be triggered by sending a se-
quence of fragmented packets with opcode 0x93. By using this sequence an at-
tacker is able to reach the following vulnerable code, and take control over the
process execution:
39581AC6 MOV EAX ,DWORD PTR DS :[EDI]
39581AC8 MOV EDX ,DWORD PTR DS :[ESI]
39581ACA AND EAX ,FFFFFFFC
39581ACD MOV ECX ,DWORD PTR DS :[EAX]
39581ACF AND EDX ,FFFFFFFC
39581AD2 MOV EDX ,DWORD PTR DS :[EDX]
39581AD4 CMP ECX ,EDX
39581AD6 JL 39581B94
39581ADC JNE SHORT 39581B2F
39581ADE LEA ECX ,[ESP+4C]
39581AE2 PUSH ECX
39581AE3 LEA EDX ,[EDI+4]
39581AE6 PUSH EDX
39581AE7 LEA ECX ,[ESP+34]
39581AEB MOV DWORD PTR SS :[ESP+58],ESI
39581AEF MOV DWORD PTR SS :[ESP+34],OFFSET
39581AF7 MOV DWORD PTR SS :[ESP+38],OFFSET
39581AFF MOV DWORD PTR SS :[ESP+3C],OFFSET
39581B07 MOV EDX ,DWORD PTR DS :[EAX+10]
39581B0A PUSH ECX
39581B0B CALL EDX
11.3 MEMORY CORRUPTION VIA FRAGMENTED PACKETS
There is a integer overflow vulnerability, which can be triggered by using a trun-
cated fragment packet, which has a packet size lesser than 4. By sending, for
instance a 2-byte packet, the following vulnerable code can be reached:
395818D7 MOV EDX ,DWORD PTR DS :[ESI]; packe t s i z e
395818D9 ADD ECX ,DWORD PTR DS :[EBX+44]
395818DC LEA EAX ,[EDI+EAX+1E]
395818E0 MOV EAX ,DWORD PTR SS :[EBP+10]
395818E3 SUB EDX ,4
395818E6 PUSH EDX ;/Arg3
395818E7 ADD EAX ,4 ; |
395818EA PUSH EAX ; |Arg2
395818EB LEA ECX ,[EDI+ECX+23]; |
27http://revuln.com/files/Ferrante_Auriemma_Exploiting_Game_Engines.pdf
ReVuln - http://revuln.com page 23 of 25