kernel alchemy pt. 1: developing exploit primitives with CVE-2025-20741
A heap overflow in the vie_oper_proc() handler writes an unbounded string into a kmalloc-128 buffer, and the post shows how to turn it into kernel exploit primitives such as an out-of-bounds read by corrupting an adjacent msg_msg size field. An attacker with the required capability could leak kernel heap memory and build further primitives toward local privilege escalation.
Hello again! I hope you all had a bit of fun with my last post going over the details of all of the bugs I reported to MediaTek last year and the interesting behavior from their triage team.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the command parser uses an unbounded string conversion into a heap buffer whose size was miscalculated, so user input can overwrite adjacent slab objects.
Impact
An attacker who can trigger the overflow could leak kernel heap memory and build further primitives, though the bug requires CAP_NET_ADMIN and the target lacks several modern kernel hardening features.
What the attacker needed
CAP_NET_ADMIN capability; ability to send iwpriv commands; world-readable dmesg for the leak
How it was found
- Create many message queues and send one message per queue sized to land in the target slab cache.
- Free every other message to open holes next to messages still owned by the attacker.
- Trigger the vulnerable command so the overflowed buffer fills a hole.
- Corrupt the adjacent message's size field with a large value.
- Read the corrupted message back to leak memory beyond its original end.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A part of the kernel that handles a device command copies text from the user into a small fixed-size memory slot without checking the length, so extra text spills into neighbouring memory. The post explains how to arrange other kernel objects next to that slot and use the spill to change their bookkeeping fields, for example making a message look longer than it is so the kernel hands back extra memory contents. This is a step toward taking over the device, not a complete attack on its own.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.