Enclosure: language-based restriction of untrusted libraries
Adrien Ghosn, Marios Kogias, Mathias Payer, James R. Larus, Edouard Bugnion
Abstract
Programming languages and systems have failed to address the security implications of the increasingly frequent use of public libraries to construct modern software. Most languages provide tools and online repositories to publish, import, and use libraries; however, this double-edged sword can incorporate a large quantity of unknown, unchecked, and unverified code into an application. The risk is real, as demonstrated by malevolent actors who have repeatedly inserted malware into popular open-source libraries.
This paper proposes a solution: enclosures, a new programming language construct for library isolation that provides a developer with fine-grain control over the resources that a library can access, even for libraries with complex inter-library dependencies. The programming abstraction is language-independent and could be added to most languages. These languages would then be able to take advantage of hardware isolation mechanisms that are effective across language boundaries.
The enclosure policies are enforced at run time by LitterBox, a language-independent framework that uses hardware mechanisms to provide uniform and robust isolation guarantees, even for libraries written in unsafe languages. LitterBox currently supports both Intel VT-x (with general-purpose extended page tables) and the emerging Intel Memory Protection Keys (MPK).
We describe an enclosure implementation for the Go and Python languages. Our evaluation demonstrates that the Go implementation can protect sensitive data in real-world applications constructed using complex untrusted libraries with deep dependencies. It requires minimal code refactoring and incurs acceptable performance overhead. The Python implementation demonstrates LitterBox's ability to support dynamic languages.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
21 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- PKRU-safe: automatically locking down the heap between safe and unsafe languages cites Spectre Attacks: Exploiting Speculative Execution
- PKRU-safe: automatically locking down the heap between safe and unsafe languages cites You shall not (by)pass!: practical, secure, and fast PKU-based sandboxing
- You shall not (by)pass!: practical, secure, and fast PKU-based sandboxing cites PKRU-safe: automatically locking down the heap between safe and unsafe languages
- PKRU-safe: automatically locking down the heap between safe and unsafe languages cites Shreds: Fine-Grained Execution Units with Private Memory
- PKRU-safe: automatically locking down the heap between safe and unsafe languages cites ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK)
- ISA-Grid: Architecture of Fine-grained Privilege Control for Instructions and Registers cites PKRU-safe: automatically locking down the heap between safe and unsafe languages
- ISA-Grid: Architecture of Fine-grained Privilege Control for Instructions and Registers cites You shall not (by)pass!: practical, secure, and fast PKU-based sandboxing
- ISA-Grid: Architecture of Fine-grained Privilege Control for Instructions and Registers cites Shreds: Fine-Grained Execution Units with Private Memory
- ISA-Grid: Architecture of Fine-grained Privilege Control for Instructions and Registers cites IMIX: In-Process Memory Isolation EXtension
- ISA-Grid: Architecture of Fine-grained Privilege Control for Instructions and Registers cites ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK)
- You shall not (by)pass!: practical, secure, and fast PKU-based sandboxing cites Spectre Attacks: Exploiting Speculative Execution
- You shall not (by)pass!: practical, secure, and fast PKU-based sandboxing cites Shreds: Fine-Grained Execution Units with Private Memory
- You shall not (by)pass!: practical, secure, and fast PKU-based sandboxing cites IMIX: In-Process Memory Isolation EXtension
- Isolating functions at the hardware limit with virtines cites ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK)
- ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK) cites Shreds: Fine-Grained Execution Units with Private Memory
- ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK) cites IMIX: In-Process Memory Isolation EXtension
Cited by top-tier papers21
- PKRU-safe: automatically locking down the heap between safe and unsafe languagesPaul Kirth, Mitchel Dickerson, Stephen Crane, Per Larsen et al.EuroSys 2022 · 41 citations
- You shall not (by)pass!: practical, secure, and fast PKU-based sandboxingAlexios Voulimeneas, Jonas Vinck, Ruben Mechelinck, Stijn VolckaertEuroSys 2022 · 33 citations
- Isolating functions at the hardware limit with virtinesNicholas C. Wanninger, Joshua J. Bowden, Kirtankumar Shetty, Ayush Garg et al.EuroSys 2022 · 17 citations
- ISA-Grid: Architecture of Fine-grained Privilege Control for Instructions and RegistersShulin Fan, Zhichao Hua, Yubin Xia, Haibo Chen et al.ISCA 2023 · 9 citations
- SysXCHG: Refining Privilege with Adaptive System Call FiltersAlexander J. Gaidis, Vaggelis Atlidakis, Vasileios P. KemerlisCCS 2023 · 9 citations
Builds on8
- Spectre Attacks: Exploiting Speculative ExecutionPaul Kocher, Jann Horn, Anders Fogh, Daniel Genkin et al.S&P 2019 · 2,435 citations
- Small World with High Risks: A Study of Security Threats in the npm EcosystemMarkus Zimmermann, Cristian-Alexandru Staicu, Cam Tenny, Michael PradelUSENIX Security 2019 · 281 citations
- ERIM: Secure, Efficient In-process Isolation with Protection Keys (MPK)Anjo Vahldiek-Oberwagner, Eslam Elnikety, Nuno O. Duarte, Michael Sammler et al.USENIX Security 2019 · 247 citations
- Shreds: Fine-Grained Execution Units with Private MemoryYaohui Chen, Sebassujeen Reymondjohnson, Zhichuang Sun, Long LuS&P 2016 · 116 citations
- IMIX: In-Process Memory Isolation EXtensionTommaso Frassetto, Patrick Jauernig, Christopher Liebchen, Ahmad-Reza SadeghiUSENIX Security 2018 · 77 citations
Related papers
- CubicleOS: a library OS with software componentisation for practical isolationVasily A. Sartakov, Lluís Vilanova, Peter R. PietzuchASPLOS 2021 · 38 citations
- Building Bridges: Safe Interactions with Foreign Languages through OmniglotLeon Schuermann, Jack Toubes, Tyler Potyondy, Pat Pannuto et al.OSDI 2025
- Retrofitting Fine Grain Isolation in the Firefox RendererShravan Narayan, Craig Disselkoen, Tal Garfinkel, Nathan Froyd et al.USENIX Security 2020
- LatticeBox: A Hardware-Software Co-Designed Framework for Scalable and Low-Latency CompartmentalizationZhanpeng Liu, Chenyang Li, Wende Tan, Yuan Li et al.NDSS 2026 · 1 citation
- TRust: A Compilation Framework for In-process Isolation to Protect Safe Rust against Untrusted CodeInyoung Bang, Martin Kayondo, Hyungon Moon, Yunheung PaekUSENIX Security 2023
