LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. In versions 1.2.1 through 1.6.55, png_set_tRNS and png_set_PLTE each alias a heap-allocated buffer between png_struct and png_info, sharing a single allocation across two structs with independent lifetimes. The trans_alpha aliasing has been present since at least libpng 1.0, and the palette aliasing since at least 1.2.1. Both affect all prior release lines png_set_tRNS sets png_ptr->trans_alpha = info_ptr->trans_alpha (256-byte buffer) and png_set_PLTE sets info_ptr->palette = png_ptr->palette (768-byte buffer). In both cases, calling png_free_data (with PNG_FREE_TRNS or PNG_FREE_PLTE) frees the buffer through info_ptr while the corresponding png_ptr pointer remains dangling. Subsequent row-transform functions dereference and, in some code paths, write to the freed memory. A second call to png_set_tRNS or png_set_PLTE has the same effect, because both functions call png_free_data internally before reallocating the info_ptr buffer. Version 1.6.56 fixes the issue.
{
"cwe_ids": [
"CWE-416"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33416.json"
}[
{
"signature_version": "v1",
"deprecated": false,
"source": "https://github.com/pnggroup/libpng/commit/d5515b5b8be3901aac04e5bd8bd5c89f287bcd33",
"digest": {
"line_hashes": [
"277710390577621166110153611286032748480",
"37812626001429359030407727102204306192",
"235108146190051955392336492964133331294",
"308819439959077714989618121299124277555",
"260397287775790088579463485285595959002"
],
"threshold": 0.9
},
"signature_type": "Line",
"id": "CVE-2026-33416-053d8287",
"target": {
"file": "pngtest.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://github.com/pnggroup/libpng/commit/d5515b5b8be3901aac04e5bd8bd5c89f287bcd33",
"digest": {
"line_hashes": [
"195793623419483107751349550499422338653",
"241481619897360395005270248340996576576",
"333957916052778635910280086895133772621",
"73182602440664933896353205027083131409",
"119279519610455638020139458056230155289",
"215279933436747534013670962459111392399"
],
"threshold": 0.9
},
"signature_type": "Line",
"id": "CVE-2026-33416-9a8d3ae7",
"target": {
"file": "png.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://github.com/pnggroup/libpng/commit/d5515b5b8be3901aac04e5bd8bd5c89f287bcd33",
"digest": {
"line_hashes": [
"166375070723291529406421301066248769034",
"275647010778297936193963675511576832388",
"256826767335212246520616614652191899280",
"279336807821086835335477021495116274772",
"53629475448747437379627006107537775352",
"46568612355367798241902050586166833318",
"245452045998668159989023841863587304868",
"114709392716353867339954008479701831121"
],
"threshold": 0.9
},
"signature_type": "Line",
"id": "CVE-2026-33416-dc375153",
"target": {
"file": "png.h"
}
},
{
"signature_version": "v1",
"deprecated": false,
"source": "https://github.com/pnggroup/libpng/commit/d5515b5b8be3901aac04e5bd8bd5c89f287bcd33",
"digest": {
"length": 481.0,
"function_hash": "241740084829777515414352894687164664979"
},
"signature_type": "Function",
"id": "CVE-2026-33416-ed236551",
"target": {
"file": "png.c",
"function": "png_get_copyright"
}
}
]
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-33416.json"