
Research Article
mShield: Protecting In-process Sensitive Data Against Vulnerable Third-Party Libraries
@INPROCEEDINGS{10.1007/978-3-031-64948-6_25, author={Yunming Zhang and Quanwei Cai and Houqiang Li and Jingqiang Lin and Wei Wang}, title={mShield: Protecting In-process Sensitive Data Against Vulnerable Third-Party Libraries}, proceedings={Security and Privacy in Communication Networks. 19th EAI International Conference, SecureComm 2023, Hong Kong, China, October 19-21, 2023, Proceedings, Part I}, proceedings_a={SECURECOMM}, year={2024}, month={10}, keywords={Memory Disclosure Memory encryption Intel SGX Isolation}, doi={10.1007/978-3-031-64948-6_25} }
- Yunming Zhang
Quanwei Cai
Houqiang Li
Jingqiang Lin
Wei Wang
Year: 2024
mShield: Protecting In-process Sensitive Data Against Vulnerable Third-Party Libraries
SECURECOMM
Springer
DOI: 10.1007/978-3-031-64948-6_25
Abstract
Third-party libraries (TPLs) are widely adopted in softwares for integrating special functions (e.g., compression) efficiently. However, as most TPLs are in the same process with the invoker, attackers could exploit memory disclosure vulnerabilities in TPLs to read the sensitive memory data of the victim process. Therefore, once a vulnerability found in a TPL, all softwares with this TPL need to be patched in time, which is impractical. In this paper, we propose a cryptography-based isolation (namedmShield) between the data memory of the invoker and TPLs, to prevent TPL vulnerabilities from being exploited to read the invoker’s sensitive memory data. mShield performs a user-mode and lightweight memory analysis, figures out the invoker’s memory space (including stack, heap, user-defined ones in BSS/data segment), encrypts them before invoking any TPL function, and automatically decrypts them once the function returns, without interrupting the normal execution. mShield performs the encryption/decryption in the trusted environment provided by Intel SGX, which prevents the attacker from reading the cryptographic key, and alerts (i.e., the invoker’s decryption fails) in time once the encryption context is tampered with (e.g., by illegal invocations of decryption). We have implemented mShield, and adopted it to protect Nginx against a potentially vulnerable TPL (i.e., zlib). The experiment demonstrates mShield’s effectiveness (TPLs fail to read the invoker’s plaintext sensitive memory data) and acceptable efficiency (about less than 4(\times )time cost).