CVE-2026-72852

hank-ai/darknet sizes a convolutional layer's weight and output heap buffers by multiplying configuration fields taken from a .cfg file in unchecked 32-bit int arithmetic. In src-lib/convolutional_layer.cpp, l.nweights is computed as (c / groups) * n * size * size and l.outputs as l.out_h * l.out_w * l.out_c, and both feed xcalloc directly. A .cfg whose true dimension product exceeds INT_MAX wraps to a small or zero value, so the allocation is undersized; for example width and height of 256 with filters of 65536 gives 2^32, which wraps to 0. forward_convolutional_layer then re-derives the GEMM dimensions with a different operand order, computing k as l.size*l.size*l.c / l.groups where the allocation divided before multiplying, and reads and writes through the undersized buffer. Loading the crafted .cfg for inference or training is sufficient and no valid .weights file is required. The reported proof of concept observed a heap buffer overflow read in gemm_nn_fast under AddressSanitizer and glibc allocator metadata corruption in a release build of the same input, indicating an out-of-bounds write.
Configurations

No configuration.

History

18 Oct 2026, 20:10

Type Values Removed Values Added
Summary
  • (es) hank-ai/darknet dimensiona los búferes de peso y de salida de una capa convolucional en el heap multiplicando campos de configuración tomados de un archivo .cfg en aritmética de enteros de 32 bits sin verificar. En src-lib/convolutional_layer.cpp, l.nweights se calcula como (c / groups) * n * size * size y l.outputs como l.out_h * l.out_w * l.out_c, y ambos alimentan directamente a xcalloc. Un .cfg cuyo producto de dimensiones real excede INT_MAX se ajusta a un valor pequeño o cero, por lo que la asignación es de tamaño insuficiente; por ejemplo, un ancho y alto de 256 con filtros de 65536 da 2^32, que se ajusta a 0. forward_convolutional_layer luego vuelve a derivar las dimensiones GEMM con un orden de operandos diferente, calculando k como l.sizel.sizel.c / l.groups donde la asignación dividió antes de multiplicar, y lee y escribe a través del búfer de tamaño insuficiente. Cargar el .cfg manipulado para inferencia o entrenamiento es suficiente y no se requiere ningún archivo .weights válido. La prueba de concepto reportada observó una lectura de desbordamiento de búfer en el heap en gemm_nn_fast bajo AddressSanitizer y corrupción de metadatos del asignador de glibc en una compilación de lanzamiento de la misma entrada, indicando una escritura fuera de límites.

Information

Published : 2026-08-20 19:17

Updated : 2026-10-18 20:10


NVD link : CVE-2026-72852

Mitre link : CVE-2026-72852

CVE.ORG link : CVE-2026-72852


JSON object : View

Products Affected

No product.

CWE
CWE-190

Integer Overflow or Wraparound

CWE-787

Out-of-bounds Write