Re: DRAFT: eXIf 2017-03-09
Cosmin Truta <[email protected]> Sun, 12 Mar 2017 16:50:42 -0400
| Newsgroups | gmane.comp.graphics.png.general |
|---|---|
| Message-ID | <CAAoVtZzWMEjKG5XB4f=xBo1tp2EazEeO+gxpjt0Y+Efvo880eA@mail.gmail.com> |
On 12 March 2017 at 16:15, Glenn Randers-Pehrson wrote: >> eXIf Recommendations for Encoders >> >> The EXIF specification allows areas of unspecified content around the >> TIFF IFD structures. Encoders should not leak uninitialized memory >> into these areas > > Why not? It's none of our business what goes in those areas. Oh. I thought you are concerned with encoders (accidentally serializing memory content out of uninitialized data, not realizing that they do so, which raises a privacy concern, in a similar manner to the Heartbleed bug), not with decoders. But if that is not the case, then never mind. > All > I said was that decoders need to be aware that such areas might > be present. Actually, the standard-compliant decoders reading valid content are fine, with or without uninitialized memory content surrounding the valid memory areas. All that decoders need to do is read the valid memory content, and not read invalid memory content pointed to by out-of-bounds offsets. The decoders need not be concerned with unspecified content around IFDs, similarly to the C string library functions that operate on snprintf output, without being concerned with snprintf not filling up an entire stack-allocated memory buffer. On the topic of hardening a decoder, the uninitialized memory areas are not an issue. A malevolent content creator may easily set an offset well within the bounds of a valid IFD which points to content that's just as harmful. It's like a pointer to a C structure that points incorrectly to well-defined, yet harmful content. We cannot address this in any effective way in our specification, other than by whacking an always-insufficient bunch of moles here and there. It is up to the decoders to figure out how to properly sanitize their inputs. Sincerely, Cosmin ------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford