Pumping Iron on the Musl Heap – Real World CVE-2022-24834 Ex... #1739
+18
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
What the post is about
NCC Group documents a real-world exploitation workflow for CVE-2022-24834 against Redis <= 7.0.11 running inside an Alpine Linux container using musl libc 1.2.4 and its mallocng allocator. Public exploits primarily targeted Ubuntu-like environments using glibc/ptmalloc2, and they failed in this Alpine/musl setup because allocator behavior changes key heap-layout assumptions.
Vulnerability recap: CVE...
🔧 Technical Details
Porting “contiguous mapping” heap exploits across allocators (ptmalloc2 → mallocng): When a vulnerability produces a huge linear out-of-bounds copy (e.g.,
0x15555555bytes), exploitation depends on keeping the entire span mapped and placing a victim allocation adjacent to the overflow buffer. On ptmalloc2 this can be achieved by extending thebrk()-heap so it stays contiguous; on musl mallocng, allocations live inmmap()-backed slab “groups” of fixed-size “slots” and fully freed groups can bemunmap()’d, creating holes. The trick is to heap-groom with mallocng’s group/slot lifecycle in mind to prevent unmapped gaps within the ~350 MiB copy range.Lua-object corruption instead of allocator metadata corruption: If the allocator is hardened (guarded out-of-band metadata, cookies), attack higher-level language/runtime objects stored on the heap. In Lua 5.1,
Tableobjects reference arrays ofTValue...🤖 Agent ActionsUpdated src/binary-exploitation/libc-heap/README.md with a new musl mallocng exploitation section covering Alpine-specific heap grooming for giant linear overflows, cycling-offset mitigation, Lua-object corruption strategy, and debugging workflow using muslheap/GdbLuaExtension. Added concise muslheap
mchunkinfoexample and appended relevant references including the NCC Group blog and tooling links.This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.