Applies to FreeImage SVN trunk r1911 (also 3.18.0 / 3.19.0 [r1859/r1909]).
CVE-2020-24293 — heap buffer overflow in psdThumbnail::Read() (PSDParser.cpp).
Raw PSD thumbnail rows memcpy width * bpp/8 bytes into a scanline whose pitch came from FreeImage_Allocate, while the source buffer is sized from a separate WidthBytes field. All four values are attacker-controlled. If they disagree, the copy writes past the DIB (and can read past a too-small WidthBytes allocation).
Fix:
Apply from the FreeImage tree root:
patch -p0 < CVE-2020-24293.patch
Independent of the CVE-2020-24295 patch; both apply to the same PSDParser.cpp.
CWE-120. CVSS 3.1 8.8 (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H)
References:
License: same as FreeImage (GPL or FIPL).
Anonymous
SVN-style unified diff against FreeImage trunk r1911 is attached (CVE-2020-24293, psdThumbnail::Read packed-row copy).
Same change: https://github.com/danoli3/FreeImage/pull/109
Siblings: 170 (ICO), 172 (ReadImageLine), 173 (PFM). Original report: https://sourceforge.net/p/freeimage/discussion/36111/thread/afb98701eb/
Apply from the FreeImage tree root: patch -p0 < CVE-2020-24293.patch