LIBPNG is a reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. From version 1.6.0 to before 1.6.51, an out-of-bounds read vulnerability exists in pngimagereadcomposite when processing palette images with PNGFLAGOPTIMIZEALPHA enabled. The palette compositing code in pnginitread_transformations incorrectly applies background compositing during premultiplication, violating the invariant component ≤ alpha × 257 required by the simplified PNG API. This issue has been patched in version 1.6.51.
{
"cwe_ids": [
"CWE-125"
]
}[
{
"id": "CVE-2025-64720-1ff2fa39",
"target": {
"file": "png.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"166375070723291529406421301066248769034",
"275647010778297936193963675511576832388",
"256826767335212246520616614652191899280",
"279336807821086835335477021495116274772",
"289998086382119027680343151146219735692",
"127562272222925286109814353033687270978",
"25813353444574047506367402039418644046",
"253582453789718568595455958296774742498"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://github.com/glennrp/libpng/commit/49363adcfaf098748d7a4c8c624ad8c45a8c3a86",
"signature_version": "v1"
},
{
"id": "CVE-2025-64720-485b33da",
"target": {
"file": "png.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"156580915294223224015440899088615326697",
"218405736567565762721805663647781263162",
"85662020663482796805838288188511316315",
"230686006833406113235008350425423979914",
"260919417129355689179955630465652050316",
"95506800799202743812829450076592490423"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://github.com/glennrp/libpng/commit/49363adcfaf098748d7a4c8c624ad8c45a8c3a86",
"signature_version": "v1"
},
{
"id": "CVE-2025-64720-a8777218",
"target": {
"file": "png.c",
"function": "png_get_copyright"
},
"digest": {
"length": 481.0,
"function_hash": "308839484675692000161271595223156832928"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://github.com/glennrp/libpng/commit/49363adcfaf098748d7a4c8c624ad8c45a8c3a86",
"signature_version": "v1"
},
{
"id": "CVE-2025-64720-e1a15be6",
"target": {
"file": "pngtest.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"52540900908244694562855646578057113774",
"200219053898519147474761570586990540810",
"23871324486584156747326023564743243101",
"63048311541359152088830007041723625585"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://github.com/glennrp/libpng/commit/49363adcfaf098748d7a4c8c624ad8c45a8c3a86",
"signature_version": "v1"
}
]
[
{
"id": "CVE-2025-64720-70fc97ff",
"target": {
"file": "pngrtran.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"33782656394079741713936793053530985262",
"117942120988824518745575478339954718732",
"37013518972150728426114520481099257510",
"113129152649379904469244060403197744722",
"148504440382215712628136361390473060849",
"6252962895702760104167041345661964672",
"189852415780201247028806368876538901045",
"155769962028449576172501037458642109605",
"127337745988919388957639519713205807898",
"293959720613656618428719165665225121884",
"311514019206986862493729774425956471724",
"330503303242598610607007919312418616620",
"49073011711973440889858581837157180648"
]
},
"deprecated": false,
"signature_type": "Line",
"source": "https://github.com/pnggroup/libpng/commit/08da33b4c88cfcd36e5a706558a8d7e0e4773643",
"signature_version": "v1"
},
{
"id": "CVE-2025-64720-aac5b68b",
"target": {
"file": "pngrtran.c",
"function": "png_init_read_transformations"
},
"digest": {
"length": 11349.0,
"function_hash": "291367314618560747532355542756971124819"
},
"deprecated": false,
"signature_type": "Function",
"source": "https://github.com/pnggroup/libpng/commit/08da33b4c88cfcd36e5a706558a8d7e0e4773643",
"signature_version": "v1"
}
]