What matters most to us is the Offset field and the OriginalCompressedSegmentSize.
The Offset is used to notify the server where the compressed data start in the SMB packet. In our previous examples, Offset was 40 bytes, meaning that 40 bytes after the SMB packet would lay the compressed data.
The OriginalCompressedSegmentSize is the size of the compressed data before compression. When sending compressed data, the client also sends what size it originally was.
Do you start to see where the problem might arise ? The Offset and OriginalCompressedSegmentSize are both size of something. They’re under the control of the client. So, what happens if the client states an Offset or OriginalCompressedSegmentSize that is not representative of reality?
If developers predicted that kind of unindented behavior, nothing serious should happen. If however, they did not, one might expect some kind of memory corruption bug to take place, buffer overflows being the main suspect.
Of course this is all rethoric, as I would not be writing about it otherwise. Now, let’s check how the server actually handles those edge cases.