RPC Overflow in WINDOWS

Source: Internet
Author: User

Yuan Ge

RPC Overflow in WINDOWS

 

The RPC parameter deserialization in WINDOWS (should it be called a scattered set ?) The input is missing check, which can easily cause buffer overflow.

.

 

For example, if GetInfoForName is called, The IDL description is as follows:

 

 

[Helpstring ("method GetInfoForName")]

HRESULT GetInfoForName

(

[In, string] const unsigned char * szVarName,

[In, out, unique, size_is (cchBuffer)] unsigned char * pchBuffer,

[In] DWORD cchBuffer,

[Out] DWORD * pcchRequired

 

);

 

Buffer pchBuffer is the input and output parameters, and its size is the value of the cchBuffer parameter, such as cchBuffer = 8, RP

C will pass the length of pchBuffer 8 and the content, while cchBuffer is another parameter, RPC will also pass.

On the RPC service provider, the parameter deserialization program of RPC decodes pchBuffer to check the validity of its length.

The decoded cchBuffer and pchBuffer have no association detection.

 

 

If we forge a small cchBuffer during RPC parameter serialization, The pchBuffer setting is relatively large.

This will cause the RPC service program to get the wrong pchBuffe size limit cchBuffer, while copying too much data to it

This causes a buffer overflow. Because RPC applies for Heap Storage parameters, pchBuffe is in the heap, so it will cause heap overflow.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.