[MS] Assessing the attack complexity of a race condition security vulnerability - devamazonaws.blogspot.com
When assessing the attack complexity of a race condition security vulnerability, you have to look not only at how small the race window is but also how easy it is to hit the window. Consider the following time-of-check-to-time-of-use (TOCTTOU) race condition. Suppose this code runs in kernel mode, and receives an InfoStruct from user mode that specifies where to put the information. struct InfoStruct { uint32_t size; char* buffer; }; void GetInfo(InfoStruct* info) { __try { // If the buffer does not point to user mode, then fail. if (!ValidateUserModeBuffer(info->buffer, info->size)) { return ERROR_INVALID_PARAMETER; } FillBufferWithData(info->buffer, info->size); return ERROR_SUCCESS; } __except (⟦ invalid user-mode pointer provided ⟧) { return ERROR_INVALID_PARAMETER; } } The race condition occurs if the user-mode buffer pointer changes after it is validated and before it is ...