Skip to content

Commit 5fa9c56

Browse files
authored
Merge branch 'AcademySoftwareFoundation:main' into R3D
2 parents bcba3ed + 91ee402 commit 5fa9c56

11 files changed

Lines changed: 111 additions & 16 deletions

File tree

SECURITY.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ None known
5050

5151
Most recent fixes listed first, more or less:
5252

53-
- CVE yet to be assigned: Signed integer overflow in SwapRGBABytes loop index leads to out-of-bounds read/write in DPX ABGR decoder / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-g267-j53j-5258) / [Fix: PR5170](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5170) (Fixed in 3.0.18.1, 3.1.13.1)
54-
- CVE yet to be assigned: Signed integer overflow in ConvertCbYCrYToRGB leads to heap out-of-bounds write in DPX 4:2:2 decoder / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-2jr5-q49v-3858) / [Fix: PR5170](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5170) (Fixed in 3.0.18.1, 3.1.13.1)
55-
- CVE yet to be assigned: Integer overflow in QueryRGBBufferSizeInternal leads to heap out-of-bounds write in DPX decoder (kCbYCr and kABGR) / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-cq46-hp4h-cvfr) / [Fix: PR5170](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5170) (Fixed in 3.0.18.1, 3.1.13.1)
56-
- CVE yet to be assigned: Integer wraparound in bounds check of decode_pixel leads to out-of-bounds read in TGA paletted image decoder / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-mq8j-73c4-cr55) / [Fix: PR5165](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5165) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
57-
- CVE yet to be assigned: HEIF Heap overflow / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-gmrp-x952-3m66) / [Fix: PR5166](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5166) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
58-
- CVE yet to be assigned: JPEG2000 (OpenJPH) signed integer overflow in buffer allocation / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-pj45-cf3g-28gq) / [Fix: PR5143](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5143) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
59-
- CVE yet to be assigned: Softimage PIC RLE decoder heap buffer overflow — longCount not clamped to image width / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-4499-j545-7q33) / [Fix: PR5142](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5142) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
60-
- CVE yet to be assigned: SGI RLE decoder heap buffer overflow — OIIO_DASSERT bounds checks are no-ops in release builds / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-jg3q-vm3q-2j35) / [#5141](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5141) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
53+
- CVE-2026-43909: Signed integer overflow in SwapRGBABytes loop index leads to out-of-bounds read/write in DPX ABGR decoder / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-g267-j53j-5258) / [Fix: PR5170](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5170) (Fixed in 3.0.18.1, 3.1.13.1)
54+
- CVE-2026-43908: Signed integer overflow in ConvertCbYCrYToRGB leads to heap out-of-bounds write in DPX 4:2:2 decoder / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-2jr5-q49v-3858) / [Fix: PR5170](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5170) (Fixed in 3.0.18.1, 3.1.13.1)
55+
- CVE-2026-43907: Integer overflow in QueryRGBBufferSizeInternal leads to heap out-of-bounds write in DPX decoder (kCbYCr and kABGR) / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-cq46-hp4h-cvfr) / [Fix: PR5170](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5170) (Fixed in 3.0.18.1, 3.1.13.1)
56+
- CVE-2026-43996: Integer wraparound in bounds check of decode_pixel leads to out-of-bounds read in TGA paletted image decoder / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-mq8j-73c4-cr55) / [Fix: PR5165](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5165) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
57+
- CVE-2026-43906: HEIF Heap overflow / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-gmrp-x952-3m66) / [Fix: PR5166](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5166) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
58+
- CVE-2026-43905: JPEG2000 (OpenJPH) signed integer overflow in buffer allocation / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-pj45-cf3g-28gq) / [Fix: PR5143](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5143) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
59+
- CVE-2026-43904: Softimage PIC RLE decoder heap buffer overflow — longCount not clamped to image width / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-4499-j545-7q33) / [Fix: PR5142](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5142) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
60+
- CVE-2026-43903: SGI RLE decoder heap buffer overflow — OIIO_DASSERT bounds checks are no-ops in release builds / [advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-jg3q-vm3q-2j35) / [#5141](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5141) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
6161
- CVE-2026-7582: DDS Image ddsinput.cpp out-of-bounds write. [#5131](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/5131) (Fixed in 3.2.0.1, 3.1.13.0, 3.0.18.0)
6262
- CVE-2024-40630: Fixed incorrect image size for certain HEIC files.
6363
[advisory](https://github.com/AcademySoftwareFoundation/OpenImageIO/security/advisories/GHSA-jjm9-9m4m-c8p2) (Fixed in 2.5.13.1)

src/dicom.imageio/dicominput.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ DICOMInput::seek_subimage(int subimage, int miplevel)
231231

232232
m_spec = ImageSpec(m_img->getWidth(), m_img->getHeight(), nchannels,
233233
format);
234+
if (!check_open(m_spec, { 0, 1 << 20, 0, 1 << 20, 0, 1 << 16, 0, 1 << 16 }))
235+
return false;
234236

235237
m_bitspersample = m_img->getDepth();
236238
if (size_t(m_bitspersample) != m_spec.format.size() * 8)

src/dpx.imageio/dpxinput.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ class DPXInput final : public ImageInput {
5757
int m_subimage;
5858
InStream* m_stream = nullptr;
5959
dpx::Reader m_dpx;
60-
std::vector<unsigned char> m_userBuf;
60+
default_init_vector<unsigned char> m_userBuf;
61+
default_init_vector<unsigned char> m_decodebuf; // temporary decode buffer
6162
bool m_rawcolor;
62-
std::vector<unsigned char> m_decodebuf; // temporary decode buffer
6363

6464
/// Reset everything to initial state
6565
///

src/jpeg.imageio/jpeginput.cpp

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@ OIIO_PLUGIN_EXPORTS_END
5252
static const uint8_t JPEG_MAGIC1 = 0xff;
5353
static const uint8_t JPEG_MAGIC2 = 0xd8;
5454

55+
static const char exif_marker_prefix[] = "Exif\0";
56+
57+
static const char icc_marker_prefix[] = "ICC_PROFILE";
58+
59+
static bool
60+
is_exif_marker(jpeg_saved_marker_ptr marker)
61+
{
62+
return marker->marker == (JPEG_APP0 + 1)
63+
&& marker->data_length >= sizeof(exif_marker_prefix)
64+
&& !memcmp(marker->data, exif_marker_prefix,
65+
sizeof(exif_marker_prefix));
66+
}
67+
68+
static bool
69+
is_icc_profile_marker(jpeg_saved_marker_ptr marker)
70+
{
71+
return marker->marker == (JPEG_APP0 + 2)
72+
&& marker->data_length >= ICC_HEADER_SIZE
73+
&& !memcmp(marker->data, icc_marker_prefix,
74+
sizeof(icc_marker_prefix));
75+
}
76+
5577

5678
// For explanations of the error handling, see the "example.c" in the
5779
// libjpeg distribution.
@@ -271,8 +293,7 @@ JpgInput::open(const std::string& name, ImageSpec& newspec)
271293
m_spec.attribute(JPEG_SUBSAMPLING_ATTR, subsampling);
272294

273295
for (jpeg_saved_marker_ptr m = m_cinfo.marker_list; m; m = m->next) {
274-
if (m->marker == (JPEG_APP0 + 1) && m->data_length >= 4
275-
&& !strncmp((const char*)m->data, "Exif", 4)) {
296+
if (is_exif_marker(m)) {
276297
// The block starts with "Exif\0\0", so skip 6 bytes to get
277298
// to the start of the actual Exif data TIFF directory
278299
decode_exif(string_view((char*)m->data + 6, m->data_length - 6),
@@ -394,8 +415,7 @@ JpgInput::read_icc_profile(j_decompress_ptr cinfo, ImageSpec& spec)
394415
memset(marker_present, 0, (MAX_SEQ_NO + 1));
395416

396417
for (jpeg_saved_marker_ptr m = cinfo->marker_list; m; m = m->next) {
397-
if (m->marker == (JPEG_APP0 + 2)
398-
&& !strcmp((const char*)m->data, "ICC_PROFILE")) {
418+
if (is_icc_profile_marker(m)) {
399419
if (num_markers == 0)
400420
num_markers = GETJOCTET(m->data[13]);
401421
else if (num_markers != GETJOCTET(m->data[13]))
@@ -427,8 +447,7 @@ JpgInput::read_icc_profile(j_decompress_ptr cinfo, ImageSpec& spec)
427447

428448
// and fill it in
429449
for (jpeg_saved_marker_ptr m = cinfo->marker_list; m; m = m->next) {
430-
if (m->marker == (JPEG_APP0 + 2)
431-
&& !strcmp((const char*)m->data, "ICC_PROFILE")) {
450+
if (is_icc_profile_marker(m)) {
432451
int seq_no = GETJOCTET(m->data[12]);
433452
if (data_offset[seq_no] + data_length[seq_no] > icc_buf.size()) {
434453
errorfmt("Possible corrupt file, invalid ICC profile\n");

testsuite/jpeg-corrupt/ref/out-alt2.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg
4444
ICCProfile:rendering_intent: "Unknown"
4545
jpeg:subsampling: "4:2:0"
4646
oiio:ColorSpace: "srgb_rec709_scene"
47+
short-exif-app1-len4-ok
48+
short-exif-app1-len5-ok
49+
short-icc-app2-len11-ok
50+
short-icc-app2-len12-ok
51+
short-icc-app2-len13-ok
4752
oiiotool ERROR: read : JPEG error: Corrupt JPEG data: 256 extraneous bytes before marker 0xdb ("src/corrupt-iptc-8011.jpg")
4853
Corrupted IPTC data
4954
Full command line was:

testsuite/jpeg-corrupt/ref/out-alt3.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg
4343
ICCProfile:rendering_intent: "Unknown"
4444
jpeg:subsampling: "4:2:0"
4545
oiio:ColorSpace: "srgb_rec709_scene"
46+
short-exif-app1-len4-ok
47+
short-exif-app1-len5-ok
48+
short-icc-app2-len11-ok
49+
short-icc-app2-len12-ok
50+
short-icc-app2-len13-ok
4651
oiiotool ERROR: read : JPEG error: Corrupt JPEG data: 256 extraneous bytes before marker 0xdb ("src/corrupt-iptc-8011.jpg")
4752
Corrupted IPTC data
4853
Full command line was:

testsuite/jpeg-corrupt/ref/out-alt4.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg
4444
ICCProfile:rendering_intent: "Unknown"
4545
jpeg:subsampling: "4:2:0"
4646
oiio:ColorSpace: "srgb_rec709_scene"
47+
short-exif-app1-len4-ok
48+
short-exif-app1-len5-ok
49+
short-icc-app2-len11-ok
50+
short-icc-app2-len12-ok
51+
short-icc-app2-len13-ok
4752
oiiotool ERROR: read : JPEG error: Corrupt JPEG data: 256 extraneous bytes before marker 0xdb ("src/corrupt-iptc-8011.jpg")
4853
Corrupted IPTC data
4954
Full command line was:

testsuite/jpeg-corrupt/ref/out-alt5.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg
4646
ICCProfile:rendering_intent: "Unknown"
4747
jpeg:subsampling: "4:2:0"
4848
oiio:ColorSpace: "srgb_rec709_scene"
49+
short-exif-app1-len4-ok
50+
short-exif-app1-len5-ok
51+
short-icc-app2-len11-ok
52+
short-icc-app2-len12-ok
53+
short-icc-app2-len13-ok
4954
oiiotool ERROR: read : JPEG error: Corrupt JPEG data: 256 extraneous bytes before marker 0xdb ("src/corrupt-iptc-8011.jpg")
5055
Corrupted IPTC data
5156
Full command line was:

testsuite/jpeg-corrupt/ref/out.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ src/corrupt-icc-4552.jpg : 1500 x 1000, 3 channel, uint8 jpeg
4444
ICCProfile:rendering_intent: "Unknown"
4545
jpeg:subsampling: "4:2:0"
4646
oiio:ColorSpace: "srgb_rec709_scene"
47+
short-exif-app1-len4-ok
48+
short-exif-app1-len5-ok
49+
short-icc-app2-len11-ok
50+
short-icc-app2-len12-ok
51+
short-icc-app2-len13-ok
4752
oiiotool ERROR: read : JPEG error: Corrupt JPEG data: 256 extraneous bytes before marker 0xdb ("src/corrupt-iptc-8011.jpg")
4853
Corrupted IPTC data
4954
Full command line was:

testsuite/jpeg-corrupt/run.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
failureok = 1
99
redirect = ' >> out.txt 2>&1 '
1010

11+
command += oiiotool("--create 1x1 3 -d uint8 -o base-short-marker.jpg")
12+
command += run_app(pythonbin + " src/make-short-marker-jpegs.py", silent=True)
13+
14+
1115
# This file has a corrupted Exif block in the metadata. It used to
1216
# crash on some platforms, on others would be caught by address sanitizer.
1317
# Fixed by #1635. This test serves to guard against regressions.
@@ -25,5 +29,19 @@
2529
# This file has a corrupted ICC profile block
2630
command += info_command ("src/corrupt-icc-4552.jpg", safematch=True)
2731

32+
# These files have short APP1/APP2 metadata marker payloads that used to be
33+
# read past their saved-marker buffers before being ignored. Use iconvert to
34+
# a null output to force a full input read.
35+
command += iconvert("short-exif-app1-len4.jpg out.null",
36+
successmessage="short-exif-app1-len4-ok")
37+
command += iconvert("short-exif-app1-len5.jpg out.null",
38+
successmessage="short-exif-app1-len5-ok")
39+
command += iconvert("short-icc-app2-len11.jpg out.null",
40+
successmessage="short-icc-app2-len11-ok")
41+
command += iconvert("short-icc-app2-len12.jpg out.null",
42+
successmessage="short-icc-app2-len12-ok")
43+
command += iconvert("short-icc-app2-len13.jpg out.null",
44+
successmessage="short-icc-app2-len13-ok")
45+
2846
# This file had corrupted IPTC data
2947
command += oiiotool("-oiioattrib imageinput:strict 1 -info -v src/corrupt-iptc-8011.jpg")

0 commit comments

Comments
 (0)