After I reported the RTP depayloader denial of service (CVE-2026-18649), I did not want to leave GStreamer. The DoS was a resource-exhaustion bug, which is the polite kind. I wanted a memory corruption. So I went looking for the places where GStreamer takes a structured thing off an untrusted channel and rebuilds it in memory, because that is where the sharp edges usually are.
That search ended at GstVideoMeta, and at a FIXME comment somebody left years ago next to a check that only looks at one byte. It got assigned CVE-2026-86476. This is how I got there, including the two or three times I was sure I had it and was wrong, and the one piece of the exploit I cannot take credit for because someone reported it first.
Picking the surface
A video frame is not just pixels. GStreamer carries a side structure called GstVideoMeta that says how the pixels are arranged: how many planes, where each plane starts (its offset), and how many bytes a row of each plane takes (its stride). Any element that reads a frame reads it according to that meta.
The interesting property is the second one I cared about: the meta can be serialized and sent to another process. The unixfd elements do exactly that. unixfdsink hands buffers to a peer over a unix socket, and unixfdsrc on the other end rebuilds them, metas and all. People use this to split a pipeline across a sandbox boundary, which means one side can be untrusted by design.
So I had a structure that controls how much memory a consumer reads, and a code path that rebuilds it from bytes an attacker can send. If the rebuild did not validate the numbers, the consumer would read based on attacker-chosen geometry. I opened video_meta_deserialize() expecting to find careful bounds checking. I found this instead: it checks that the byte reader did not run out of input, that the plane count is not absurd, and that the version field is not zero. That is it. The offsets and strides are copied straight out of the stream. The strides are even read as signed 32-bit integers, so you can hand it a negative one and it will take it.
That was enough to keep going.
The first version, which was cheating
My first instinct was to prove the consumer side as fast as possible. I did not bother with the socket. I built a buffer with a few bytes of real memory, attached a GstVideoMeta to it directly with gst_buffer_add_video_meta_full(), set the plane strides to a million, and pushed it into videoconvert.
It crashed immediately. AddressSanitizer printed a heap-buffer-overflow read inside video_orc_convert_I420_BGRA, which is the generated kernel videoconvert uses to turn I420 into BGRA. Great, the consumer trusts the meta. But I sat with it for a minute and realized this proof was worthless as a security claim. gst_buffer_add_video_meta_full() is an in-process API. If an attacker can already call it, they are already running code in your address space. I had proven that a program that lies to itself can hurt itself.
The whole point was the trust boundary. The bug is only a bug if the lie can come from outside. So I threw that PoC away and rebuilt it around the real path: fakesrc ! capsfilter ! unixfdsink on one side pushing a perfectly valid 320x240 I420 buffer, with a GstVideoMeta whose strides were a million, and unixfdsrc ! videoconvert ! capsfilter ! fakesink on the other. The receiving capsfilter forces I420 to BGRA so videoconvert cannot just pass the buffer through. It has to read it, and it reads it by the meta’s strides.
I put a probe on the receiver to print the strides it saw after deserialization. They came across as a million, unchanged. The lie survived the socket. Then ASan fired on the receiver side, same kernel, same overflow. Now it meant something: the bytes came from a peer.
The one-byte check
I still did not understand why the map succeeded at all. A plane claiming a million-byte stride against a few bytes of memory should fail somewhere. So I followed the mapping code down into default_map() in gstvideometa.c, and there it was:
offset = meta->offset[plane];
/* FIXME use plane size */
if (!gst_buffer_find_memory (buffer, offset, 1, &idx, &length, &skip))
goto no_memory;
The third argument to gst_buffer_find_memory() is the size you want to be present. It is 1. The code confirms that a single byte exists at the plane’s start and then trusts the stride for everything after. And directly above it, in the source, somebody had already written FIXME use plane size. The gap was known. It just never got closed.
There was a second missing check too. The function that maps a frame, gst_video_frame_map_id(), has two branches. The one for buffers without a meta ends with if (frame->map[0].size < info->size) goto invalid_size;, which is the sanity check that the memory is big enough. The branch that runs when a meta is present does not have it. The meta branch only checks that the frame is not smaller than the format expects, never that it is not larger than the memory allows. Two different people could have written those two branches and neither of them would have caught this.
The write that was not there
At this point I had a solid out-of-bounds read reachable from a peer. A read crash and an info leak is a real finding, but I wanted to know if it was worse. For that I needed a write, and the copy path gives you one in principle. gst_video_frame_copy_plane() does a memcpy of stride * height bytes, so if a buffer carrying the lying meta is the destination of a copy, the lie overflows the destination.
The problem was that my stock unixfd pipeline would not produce a heap write no matter how I arranged it. I kept getting reads. I spent a while convinced I was arranging the elements wrong.
I was not. The reason is in how unixfdsink handles a buffer that is not backed by a file descriptor. It copies it into shared memory, a memfd, and ships the fd. So on the receiver, the pixel data is not a normal heap allocation. It is an mmap’d region. When videoconvert reads past the end of it by the lying stride, it runs off the end of a mapping and the process dies, or it reads adjacent mapped bytes and leaks them downstream. What it does not do is step on a heap chunk next door, because there is no heap chunk next door. That is why the stock path is a read and a crash, not a write.
I think this distinction is where a lot of writeups would quietly round up, so I want to be plain about it. The stock pipeline is a remotely reachable read and crash. The write primitive is real, but to exercise it I drove the exact same deserializer with the exact same attacker bytes and placed the resulting meta on a small heap buffer, so the copy’s destination was heap memory. Same code, same input, different allocation underneath. That is honest about what the transport does and still shows the write exists.
Getting to system()
Once the destination was a heap buffer, the overflow walked into whatever sat after it, and I made what sat after it a reference-counted object I could pick. GStreamer objects start with a header, and part of that header is a free function pointer that gets called when the object’s refcount hits zero. I overflowed into a neighbouring object’s header and overwrote that pointer, laid out the surrounding fields so the object’s type word landed in the first argument register at call time, put "id" there, and dropped the last reference.
[+] deserialized GstVideoMeta: ok (consumed=74)
[+] overwriting victim->free = 0x7fc16d043490 via OOB memcpy...
[+] victim->free now = 0x7fc16d043490
[+] triggering unref...
uid=1000(kali) gid=1000(kali) groups=...
That last line is system() running id. Swap the string for /bin/sh and it is a shell.
One gotcha worth saving you: the RCE PoC runs on a normal build, not an ASan one. An ASan build aborts on the very first overflowing memcpy, because the overflow is the exact thing ASan is built to catch. ASan is how you prove the bug. A stock build is how you prove the impact. You need both, on separate runs.
The ASLR part, and giving credit
To overwrite that free pointer with the address of system(), I had to know where system() was, and modern binaries randomize that. The clean way to solve it is to leak one pointer you do understand and compute everything else from fixed offsets, with no dlsym and no reading /proc/self/maps.
I had a leak into libgstreamer, so I could get the library base. From there I needed a bridge into libc, and that is where it got finicky. The obvious candidates all fail for instructive reasons. stdout and stderr are data symbols and get caught by copy relocations, so their slots can point into the main executable instead of libc. memcpy and strcmp are IFUNCs, resolved to a CPU-specific implementation at an offset that moves between machines. The malloc and free slots in libgstreamer never get used, because GStreamer allocates through glib, so they sit cold at their PLT stubs. The one that works is __cxa_finalize: it is a real function, so copy relocations leave it alone, it is not an IFUNC, so its offset is fixed, and it is bound eagerly at load, so it is always populated. Every compiler-emitted shared object references it for destructor teardown. Read that slot, subtract its libc offset, and you have the libc base, and from there system().
It worked, stable across runs. And then I went to write it up and found that researchers at Anthropic had reported essentially the same offset-resolution technique first.
I want to be straight about that. I arrived at it on my own, and I was pleased with it, and it does not matter, because they were first and they reported it. So I am not claiming the ASLR bypass. The bug is mine: the three missing checks in libgstvideo and the fact that an untrusted deserialized GstVideoMeta reaches all of them. The trick for turning one leak into a libc address is theirs. Both things can be true, and pretending otherwise would be the kind of thing that catches up with you.
What I took from it
A few things held up across both GStreamer bugs now.
Follow the untrusted structure, not the obvious entry point. The RTP bug came from an endless stream of valid packets. This one came from a serialized struct that gets rebuilt without validation. In both cases the interesting code was the part that believed its input.
Prove it across the real boundary or you have not proven anything. My first GstVideoMeta crash was through an in-process API, and it told me nothing about security. The version through unixfdsrc is the one that counts, because the lie comes from a peer.
Know the difference between a crash and a write, and do not blur it. The transport turned my overflow into a read against a memfd, and it would have been easy to wave my hands and call the whole thing RCE. Separating the confirmed read from the demonstrated write, and saying exactly how I bridged them, is the part I am most willing to defend.
And when someone beats you to a piece of it, say so. The bug is still a good bug.