ts::

1750291200

22 min

Heap grooming on musl: a practical tcache-free primitive

Notes on turning an off-by-one in a mallocng-backed allocator into a reliable arbitrary write on modern Alpine builds.

#binary-exploitation

#musl

#heap

Why musl is different

Most public heap research targets glibc. Alpine containers use musl, and its mallocng allocator keeps metadata out of band. Many familiar assumptions simply do not apply.

That design removes a whole family of classic corruption paths, but it does not make small memory errors harmless. It just moves the interesting state somewhere else.

What changed in practice

Reliability came from understanding allocation groups and predicting layout, not from any single trick. Most of the work was careful measurement across builds.

Takeaways for defenders

Treat off-by-one bugs as serious on every allocator. Keep Alpine base images patched, and fuzz against the libc you actually ship.

© 2026 white_devil — all disclosures coordinated.

connection: TLS1.3 // AES-256-GCM // session integrity verified

© 2026 white_devil — all disclosures coordinated.

connection: TLS1.3 // AES-256-GCM // session integrity verified

Create a free website with Framer, the website builder loved by startups, designers and agencies.