Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 469

Heap Feng Shui

What is Heap Feng Shui?

Heap Feng ShuiDeterministic heap-grooming technique introduced by Alexander Sotirov in 2007 that arranges allocations to land vulnerable objects next to attacker-controlled ones.


Alexander Sotirov coined Heap Feng Shui at Black Hat Europe 2007. Whereas heap spraying is statistical, feng shui carefully allocates, frees and re-allocates objects in JavaScript to shape the browser heap so that, after triggering a memory corruption, the vulnerable object reliably overlaps with attacker-controlled bytes. By exhausting freelists, exploiting size-class bins, and using long-lived allocations as anchors, exploits achieve deterministic layouts even under ASLR and randomized allocators. The idea generalised to kernel heap grooming (Linux SLUB, Windows pool feng shui) and to JavaScript engine exploitation (V8, SpiderMonkey). Modern mitigations include hardened allocators (PartitionAlloc, scudo), MTE on ARM, GWP-ASan, and isolated heaps for sensitive metadata.

Examples

  1. 01

    Triggering precise allocations in JavaScript to position a vulnerable JIT object next to an attacker-controlled ArrayBuffer.

  2. 02

    Linux kernel SLUB feng shui to align a UAF object with cred structures and gain root.

Frequently asked questions

What is Heap Feng Shui?

Deterministic heap-grooming technique introduced by Alexander Sotirov in 2007 that arranges allocations to land vulnerable objects next to attacker-controlled ones. It belongs to the Attacks & Threats category of cybersecurity.

What does Heap Feng Shui mean?

Deterministic heap-grooming technique introduced by Alexander Sotirov in 2007 that arranges allocations to land vulnerable objects next to attacker-controlled ones.

How does Heap Feng Shui work?

Alexander Sotirov coined Heap Feng Shui at Black Hat Europe 2007. Whereas heap spraying is statistical, feng shui carefully allocates, frees and re-allocates objects in JavaScript to shape the browser heap so that, after triggering a memory corruption, the vulnerable object reliably overlaps with attacker-controlled bytes. By exhausting freelists, exploiting size-class bins, and using long-lived allocations as anchors, exploits achieve deterministic layouts even under ASLR and randomized allocators. The idea generalised to kernel heap grooming (Linux SLUB, Windows pool feng shui) and to JavaScript engine exploitation (V8, SpiderMonkey). Modern mitigations include hardened allocators (PartitionAlloc, scudo), MTE on ARM, GWP-ASan, and isolated heaps for sensitive metadata.

How do you defend against Heap Feng Shui?

Defences for Heap Feng Shui typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for Heap Feng Shui?

Common alternative names include: Heap grooming.

Related terms