Repository navigation
FreeImage 3.19.33
Security fixes for JPEG XR, HDR, IFF, PICT and WBMP loading, and a SharpYUV WebP save flag. Upgrading is recommended for any application that loads untrusted images.
Security fixes
| Advisory | Format | Issue | Reporter |
|---|---|---|---|
| GHSA-gwj3-px9g-x6gf | JPEG XR | Heap buffer overflow in metadata parsing (BUILD_JXR=ON) |
marcellomaugeri |
| GHSA-2jrc-675j-96jw | JPEG XR | Out-of-bounds stack read in container signature parsing | marcellomaugeri |
| GHSA-994h-2f6q-8wh6 | JPEG XR | Out-of-bounds stack read in codestream signature parsing | marcellomaugeri |
| GHSA-hv6w-96fr-cc96 | HDR | Negative height or width causes an out-of-bounds heap write | michaelknap |
| GHSA-jxrm-w825-p3xp | IFF | Malformed FORM or chunk size causes an infinite loop | michaelknap |
| GHSA-q9vw-fx7r-5qmp | PICT | Truncated input causes an infinite loop | michaelknap |
| GHSA-65pp-rfw7-4xq6 | WBMP | Truncated extension header causes an infinite loop | michaelknap |
- JPEG XR metadata:
ReadBinaryData()sized its buffer asuCount + 2in 32-bit arithmetic, so a count of 0xFFFFFFFE or 0xFFFFFFFF wrapped to a 0 or 1 byte allocation while the stream was still asked for the full count. The count is now widened tosize_tfirst, and counts that would overflow are rejected. - JPEG XR signatures: the container (
II) and codestream (WMPHOTO) signatures were read into unterminated stack buffers and checked withstrstr(), which ran past the buffer on non-zero input. Both are now compared withmemcmp(). - HDR: header dimensions were parsed through signed
%dinto unsigned values. They are now rejected unless positive. - IFF: FORM and chunk sizes, odd-length padding and offsets are now validated before chunks are skipped.
- PICT:
Read8()returned a synthetic zero at end of file, which the header loop treated as padding forever. Failed reads now stop parsing. - WBMP: a failed read left the continuation bit set so the parser never advanced. Every header read must now return its byte.
Regression tests (JxrMetadataCountTest, JxrSignatureTest, and the HDR, IFF, PICT and WBMP tests) reproduce these bugs under AddressSanitizer without the fixes.
New
WEBP_SHARPYUVsave flag for SharpYUV RGB to YUV conversion in lossy WebP. Combine it with a quality value.
Notes
- No bundled library versions changed since 3.19.32. LibJXR carries local fixes in
JXRMeta.c,JXRGlueJxr.candstrdec.c; keep them when re-syncing jxrlib. - The JPEG XR advisories only affect builds with
BUILD_JXR=ON, which is on by default on Windows.
Contributors
Thanks to everyone who contributed to this release:
-
@michaelknap: reported and fixed the HDR, IFF, PICT and WBMP vulnerabilities (GHSA-hv6w-96fr-cc96, GHSA-jxrm-w825-p3xp, GHSA-q9vw-fx7r-5qmp, GHSA-65pp-rfw7-4xq6)
-
@marcellomaugeri: reported the JPEG XR vulnerabilities (GHSA-gwj3-px9g-x6gf, GHSA-2jrc-675j-96jw, GHSA-994h-2f6q-8wh6)
-
@danoli3: JPEG XR fixes, the
WEBP_SHARPYUVflag and the release -
@michaelknap is both reporter and fix author. The four commits (47e48ab, 31af402, 8d57767, b92f945) are authored under that GitHub login.
-
@marcellomaugeri is a reporter only. The JPEG XR fixes themselves were written by @danoli3.
-
@danoli3 authored the other commits in the range.
Full changelog: https://github.com/danoli3/FreeImage/blob/3.19.33/CHANGELOG.md
Compare: 3.19.32...3.19.33
What's Changed
- Add WEBP_SHARPYUV save flag (SharpYUV for lossy WebP) by @danoli3 in #278
- FreeImage 3.19.33 by @danoli3 in #279
- Fix JPEG XR signature out-of-bounds stack reads by @danoli3 in #280
Full Changelog: 3.19.32...3.19.33