Tuesday, September 29, 2026

CFXMLParser 7-Byte Crasher

Nicolas Seriot:

// "<a>" in UTF-16 LE + a single dangling byte
const UInt8 bytes[] = {'<', 0, 'a', 0, '>', 0, 'X'};

[…]

The whole bug is a confusion between bytes left versus UTF-16 characters left. The result is repeated buffer doubling until allocation fails, and a local process crash if the exception is uncaught.

3 Comments RSS · Twitter · Mastodon


This post is cool but CFXMLParser has been deprecated since 10.8. Can we get some posts about new bugs in frameworks like Foundation.


> This post is cool but CFXMLParser has been deprecated since 10.8.

There are plenty of software that use deprecated APIs and run on the latest OS versions. In the case of Apple platforms, it's either to maintain backward compatibility or because the "geniuses" at Cupertino deprecate/obsolete APIs/frameworks before (ever)? providing a replacement (I'm not event talking about a reliable one).


> "...Cupertino deprecate/obsolete APIs/frameworks before (ever)? providing a replacement ..."

Good point, but let me give you another reason... GLKit, as in OpenGL. It's been deprecated since iOS 12 and macOS 10.14, replaced with Metal. Yet here we are, 8 years later. Is Metal *better* or *more modern* than OpenGL? Debatable. But realistically, in technical terms please, how can Apple break something that would immediately obsolete a decent percentage of apps out there?

Leave a Comment