CVE-2026-48040: Netty Jni Direct Buffer Offset Bypass

A native memory pointer is retrieved from a Netty ByteBuf by fallback to `internalNioBuffer(0, buffer.capacity())`. JNI's `GetDirectBufferAddress` returns the base address of the shared chunk. By passing the full capacity and ignoring the explicit slice offset (`ByteBuffer.position()`), out-of-bounds access happens on pooled buffers. Calculate memory address

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Javaβ
greprules fetch cve-2026-48040-netty-jni-direct-buffer-offset-bypass --engine opengrep

Description

A native memory pointer is retrieved from a Netty ByteBuf by fallback to `internalNioBuffer(0, buffer.capacity())`. JNI's `GetDirectBufferAddress` returns the base address of the shared chunk. By passing the full capacity and ignoring the explicit slice offset (`ByteBuffer.position()`), out-of-bounds access happens on pooled buffers. Calculate memory address