6.5medium
0 byte write heap buffer overflow in start_decoder in stb_vorbis
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.74% (higher than 55% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
Description
stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. A crafted file may trigger out of bounds write in `f->vendor[len] = (char)'\0';`. The root cause is that if the len read in `start_decoder` is `-1` and `len + 1` becomes 0 when passed to `setup_malloc`. The `setup_malloc` behaves differently when `f->alloc.alloc_buffer` is pre-allocated. Instead of returning `NULL` as in `malloc` case it shifts the pre-allocated buffer by zero and returns the currently available memory block. This issue may lead to code execution.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| nothings stb | <= 1.22, up to 1.22 | CVE List |
| nothings stb_vorbis.c | 1.22 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. A crafted file may trigger out of bounds write in `f->vendor[len] = (char)'\0';`. The root cause is that if the len read in `start_decoder` is `-1` and `len + 1` becomes 0 when passed to `setup_malloc`. The `setup_malloc` behaves differently when `f->alloc.alloc_buffer` is pre-allocated. Instead of returning `NULL` as in `malloc` case it shifts the pre-allocated buffer by zero and returns the currently available memory block. This issue may lead to code execution.
NVD (es)
stb_vorbis es una librería de archivo único con licencia MIT para procesar archivos ogg vorbis. Un archivo manipulado puede provocar una escritura fuera de límites en `f->vendor[len] = (char)'\0';`. La causa principal es que si el len leído en `start_decoder` es `-1` y `len + 1` se convierte en 0 cuando se pasa a `setup_malloc`. `setup_malloc` se comporta de manera diferente cuando `f->alloc.alloc_buffer` está preasignado. En lugar de devolver "NULL" como en el caso de "malloc", desplaza el búfer preasignado a cero y devuelve el bloque de memoria disponible actualmente. Este problema puede provocar la ejecución del código.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-45675 changed 2025-02-13 | CVE Terms of Use |
| NVD | CVE-2023-45675 changed 2026-06-17 | Public domain |