Abstract
There is an increased emphasis on attacks that utilize heap buffer overflow vulnerabilities to target critical metadata and sensitive data in programs. Mitigation solutions implemented within the same virtual memory space are vulnerable to attacks that leverage program metadata to gain further control of a user buffer or to manipulate the memory layout for the purpose of overflowing specific data. Solutions such as Intel's Software Guard Extensions (SGX) provide hardware-separated memory space using enclaves to protect critical data. We present METASAFE, a novel set of heap management APIs that leverages Intel's SGX to protect against tampering of heap metadata by securing the critical data within the enclaves. METASAFE's API suite is designed for ease of use so that the programmers can protect and manage critical data of user programs without significantly modifying the current programming model. METASAFE is evaluated on several open source projects, such as ngingx, nullhttpd, netcat and gzip. Finally, we present a use case in which METASAFE is used to secure the RSA private key in the OpenSSL Library. We evaluate the security of the key using a Metasploit module based on the famous Heartbleed exploit and show that in spite of a vulnerability, an attacker cannot access the key.