jp2/opj_decompress.c in OpenJPEG through 2.3.1 has a use-after-free that can be triggered if there is a mix of valid and invalid files in a directory operated on by the decompressor. Triggering a double-free may also be possible. This is related to calling opj_image_destroy twice.
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory “belongs” to the code that operates on the new pointer.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Openjpeg | Uclouvain | * | 2.3.1 (including) |
Red Hat Enterprise Linux 8 | RedHat | openjpeg2-0:2.4.0-4.el8 | * |
Ghostscript | Ubuntu | trusty | * |
Openjpeg2 | Ubuntu | bionic | * |
Openjpeg2 | Ubuntu | devel | * |
Openjpeg2 | Ubuntu | esm-apps/bionic | * |
Openjpeg2 | Ubuntu | esm-apps/xenial | * |
Openjpeg2 | Ubuntu | esm-infra/focal | * |
Openjpeg2 | Ubuntu | focal | * |
Openjpeg2 | Ubuntu | groovy | * |
Openjpeg2 | Ubuntu | hirsute | * |
Openjpeg2 | Ubuntu | impish | * |
Openjpeg2 | Ubuntu | jammy | * |
Openjpeg2 | Ubuntu | kinetic | * |
Openjpeg2 | Ubuntu | lunar | * |
Openjpeg2 | Ubuntu | trusty | * |
Openjpeg2 | Ubuntu | upstream | * |
Openjpeg2 | Ubuntu | xenial | * |