arXiv:2611.18910cs.CRNov 2026

Manuscript Offprint

arXiv:2611.18910

Memory Safety Isn't All You Need: Code Reuse Attacks in Memory Safe Languages

Eric Cornelissen, Musard Balliu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Memory safety rules out classical code reuse attacks that rely on arbitrary memory corruption, but does not eliminate code reuse altogether. Attacks such as object injection, prototype pollution, class pollution, DOM clobbering, and DOM script gadgets arise in memory-safe languages without violating the underlying memory safety abstraction. We show that these seemingly different attacks share a common structure: Attacker-controlled data influences accesses to shared runtime state, such as runtime type information, prototype or class state, and the DOM, and a value fetched from that state subsequently influences a security-sensitive operation. Drawing on this insight, we develop a language-agnostic framework that decomposes an attack into a weakness, ending in a fetch from shared runtime state, and a gadget, which propagates the fetched value to a sensitive sink. We show that the framework captures five established attack classes and use it to derive stateless, mutating, and recycling weaknesses, together with simple, vertical, and horizontal gadget structures. We further systematize existing defenses into three common strategies - mediation, minimization, and constraint - and use them to derive candidate defense directions. Finally, we develop a model language that gives a formal account of code-reuse weaknesses and potential conditions for gadgets and end-to-end vulnerabilities.

A PDF page turning into lines of clean text

Preparing the full text

It will appear here by itself. You can read the abstract meanwhile.