Crop Enclave Interface for SGX Programs
Yaqi Fan, Zhifeng Chen, Qingbao Li, Wenbo Deng · 2023
Existing memory attacks against SGX use the enclave interface, such as ECALLs and OCALLs, to inject malicious data into the enclave’s trusted memory to trigger memory corruption vulnerabilities therein. Therefore, enclave interface security becomes a key issue in defending against such attacks. However, a comprehensive static analysis of source SGX programs is currently lacking to obtain sufficient a priori knowledge to provide effective runtime interface protection for the enclave. In view of this, we identify 8 types of unsafe input data of enclave and design a new interface cropping method, SGXCrop. This method extracts critical interface information from source SGX programs, including ECALLs in use and unsafe input data, which are cropped at runtime of SGX programs. Tests in real SGX environment verify that the proposed method can effectively crop illegal ECALLs and unsafe input data.