Skip to content
Memory corruption Advisory Advanced CVE-2021-30695

Apple macOS ModelIO USD Parsing Out-Of-Bounds Read Information Disclosure Vulnerability

The ModelIO framework in Apple macOS reads past the end of an allocated data structure when parsing a crafted USD file. An attacker could use this to disclose sensitive information, and could combine it with other flaws to run arbitrary code in the current process.

Mickey Jin Follow

Originally disclosed on Zero Day Initiative

This vulnerability allows remote attackers to disclose sensitive information on affected installations of Apple macOS. Interaction with the ModelIO library is required to exploit this vulnerability but attack vectors may vary depending on the implementation.

Mickey Jin (@patch1t) & Junzhi Lu (@pwn0rz) of Trend Micro, on the Zero Day Initiative

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

Apple macOS ships the ModelIO framework, a library that applications use to work with 3D model assets. One of the formats it handles is USD. The advisory describes a flaw in how ModelIO parses crafted data inside a USD file: a read past the end of an allocated data structure. The affected asset is Apple's macOS, and the issue was handled through the Zero Day Initiative programme.

The weakness class is an out-of-bounds read that leads to information disclosure. The advisory rates it low severity with a CVSS score of 3.3.

Setup

Exploiting the flaw requires interaction with the ModelIO library, but the advisory notes that attack vectors may vary depending on the implementation. In other words, the exact way a victim is made to process a malicious USD file depends on the application that uses ModelIO. No specific tooling, accounts or versions are given in the advisory.

Finding it

The specific flaw exists within the ModelIO framework. Crafted data in a USD file can trigger a read past the end of an allocated data structure. That is the whole of the technical description: the advisory does not show the malformed file, the parsing routine involved, or the bytes that are read out of bounds.

Exploitation

The advisory does not publish a proof of concept, so there are no requests, payloads or commands to reproduce. The exploitation path it describes is:

  1. An attacker crafts a USD file containing data that drives ModelIO past the end of an allocated data structure.
  2. A target application that uses ModelIO processes the file, which requires interaction with the library.
  3. The out-of-bounds read discloses sensitive information from the process.
  4. The attacker can leverage this in conjunction with other vulnerabilities to execute arbitrary code in the context of the current process.

The disclosure on its own is therefore a building block: the advisory frames code execution as something achieved by combining this bug with other vulnerabilities, not by this bug alone.

Root cause

The advisory states only that ModelIO reads past the end of an allocated data structure while parsing crafted USD data. It does not identify the function, the missing length or bounds check, or the parser state that allows the over-read, so the precise coding mistake is not public in this text. Why existing defences did not stop it is likewise not described.

Impact

A remote attacker can disclose sensitive information on affected installations of Apple macOS. The victim has to interact with the ModelIO library, through whatever application processes the crafted USD file, and the advisory is explicit that attack vectors may vary by implementation. On its own the bug leaks memory contents; chained with other vulnerabilities it can contribute to arbitrary code execution in the context of the current process. The issue is rated low severity with a CVSS score of 3.3.

Fix

Apple issued an update to correct the vulnerability. The advisory points to Apple's security advisory HT212529 for details:

Text
https://support.apple.com/HT212529

The advisory does not describe the code change itself.

Variants to test

Because the advisory gives no parser internals, the concrete variants follow from the general shape of the bug: file-format parsers that trust lengths and offsets embedded in the file.

  1. Other ModelIO-supported model formats: feed files with truncated or inconsistent size fields and watch for reads beyond the buffer, for example memory contents appearing in output derived from the file.
  2. Other USD consumers on macOS: applications that load USD assets through different code paths, since the advisory says vectors vary by implementation.
  3. Other Apple media and model frameworks that parse structured container formats: a positive result is a crash under a memory sanitiser or disclosed heap contents reflected back to the attacker.

Hunting notes

This class of bug tends to hide in parsers for complex, chunked file formats where offsets and lengths are read from the file and used without validation against the actual buffer size. During recon, the signals are applications that open untrusted model or media files, especially through system frameworks, and any crash reports showing reads near allocation boundaries. The report was made to the vendor on 2021-02-12 and released as a coordinated public advisory on 2021-06-25. Credit goes to Mickey Jin (@patch1t) and Junzhi Lu (@pwn0rz) of Trend Micro.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

Apple's macOS operating system includes a piece of software called the ModelIO framework. A framework is a reusable bundle of code that many applications can share, a bit like a set of kitchen tools that every cook in a building can borrow instead of each buying their own. ModelIO's job is to help applications work with 3D models: the digital objects you see in games, design tools and animations.

One of the file formats ModelIO understands is called USD. A file format is simply an agreed way of arranging data inside a file so that software can read it back, the way a recipe is an agreed order for ingredients and steps. A USD file stores a 3D model together with information about how it is built.

The advisory describes a mistake in the way ModelIO reads certain data inside a USD file. When the file contains specially crafted data, ModelIO reads past the end of a block of memory it had set aside. Memory is the computer's working space, and reading past the end of an allocated block is like reading the lines after the end of a page in a notebook: you see whatever happens to be written there, which was never meant to be shown. That is why the problem is called an out-of-bounds read, and why the result is called information disclosure: information that should have stayed private can leak out.

The issue was handled through the Zero Day Initiative, a programme that collects vulnerability reports and coordinates with the companies that make the affected software. The affected product is Apple's macOS. The issue is rated low severity, with a CVSS score of 3.3. CVSS is a standard scoring system for how serious a security flaw is; 3.3 is on the low end of its scale.

Context

To follow the rest, three ideas help.

A library is code that other programs call on to do a job, rather than writing that job from scratch. ModelIO is a library inside macOS, and applications use it to load and handle 3D model assets. An asset here just means a file of content, such as a model, that an application loads.

USD is a file format for 3D scenes and models. Think of it as a container: inside it are structured records describing shapes, positions and other properties. Because the format is structured, a program reading it has to trust numbers written in the file, such as where a piece of data starts and how long it is. That trust is exactly where this kind of bug tends to appear.

The weakness class is an out-of-bounds read that leads to information disclosure. An out-of-bounds read means the program asks for data outside the region it was given. Information disclosure means some of the contents of memory can end up somewhere the attacker can see.

Setup

Exploiting the flaw requires interaction with the ModelIO library, but the advisory notes that attack vectors may vary depending on the implementation. An attack vector is the route by which the malicious file reaches the victim's machine: an email attachment, a download, a shared document, and so on. An implementation is a particular application's own way of using the library.

In plain terms: the exact way a victim is made to process a malicious USD file depends on which application uses ModelIO to open it. The advisory gives no specific tooling, accounts or versions, so there is nothing to install or configure from this text alone.

Finding it

The specific flaw exists within the ModelIO framework. Crafted data in a USD file can trigger a read past the end of an allocated data structure. An allocated data structure is a block of memory the program reserved for a particular purpose; the program is only allowed to read inside that block.

That is the whole of the technical description. The advisory does not show the malformed file, the parsing routine involved, or the bytes that are read out of bounds. Parsing means reading a file and turning its raw contents into something the program can use, the way you turn a page of text into sentences and meaning.

Exploitation

The advisory does not publish a proof of concept, so there are no requests, payloads or commands to reproduce. A proof of concept is a small demonstration that reliably triggers a bug. A payload is the piece of data designed to cause the effect.

The exploitation path it describes is:

  1. An attacker crafts a USD file containing data that drives ModelIO past the end of an allocated data structure.
  2. A target application that uses ModelIO processes the file, which requires interaction with the library.
  3. The out-of-bounds read discloses sensitive information from the process.
  4. The attacker can leverage this in conjunction with other vulnerabilities to execute arbitrary code in the context of the current process.

A process is a running program, with its own private area of memory. To execute arbitrary code means to make the computer run instructions of the attacker's choosing, which is the most serious outcome in this field. The advisory frames that outcome as something achieved by combining this bug with other vulnerabilities, not by this bug alone. The disclosure on its own is therefore a building block: it leaks memory contents, and that leak can help an attacker plan a larger attack.

Root cause

The advisory states only that ModelIO reads past the end of an allocated data structure while parsing crafted USD data. It does not identify the function, the missing length or bounds check, or the parser state that allows the over-read. A bounds check is a test that confirms a position or length stays inside the allowed region before the program uses it; a missing bounds check is the classic cause of this kind of bug. The precise coding mistake is not public in this text, and why existing defences did not stop it is likewise not described.

Impact

A remote attacker can disclose sensitive information on affected installations of Apple macOS. Remote means the attacker does not need to be sitting at the machine. The victim has to interact with the ModelIO library, through whatever application processes the crafted USD file, and the advisory is explicit that attack vectors may vary by implementation.

On its own the bug leaks memory contents. Chained with other vulnerabilities it can contribute to arbitrary code execution in the context of the current process.

Fix

Apple issued an update to correct the vulnerability. The advisory points to Apple's security advisory HT212529 for details:

Text
https://support.apple.com/HT212529

This block is a single web address. It is the page where Apple published its own note about the update. You would open it in a browser to read Apple's version of the fix. The advisory does not describe the code change itself.

Variants to test

Because the advisory gives no parser internals, the concrete variants follow from the general shape of the bug: file-format parsers that trust lengths and offsets embedded in the file. An offset is a number saying where something sits inside a file; a length says how much data there is. If a program believes those numbers without checking them against the real file size, it can be steered outside its buffer.

  1. Other ModelIO-supported model formats: feed files with truncated or inconsistent size fields and watch for reads beyond the buffer, for example memory contents appearing in output derived from the file.
  2. Other USD consumers on macOS: applications that load USD assets through different code paths, since the advisory says vectors vary by implementation.
  3. Other Apple media and model frameworks that parse structured container formats: a positive result is a crash under a memory sanitiser or disclosed heap contents reflected back to the attacker.

A memory sanitiser is a debugging tool that watches memory access and stops the program when it steps outside the allowed region. The heap is the part of memory a program uses for data it creates while running.

Hunting notes

This class of bug tends to hide in parsers for complex, chunked file formats where offsets and lengths are read from the file and used without validation against the actual buffer size. Chunked means the file is split into labelled sections, each with its own size, so a reader must keep track of where each section ends.

During recon, the signals are applications that open untrusted model or media files, especially through system frameworks, and any crash reports showing reads near allocation boundaries. Recon is the early stage of looking around for targets and weak points.

The report was made to the vendor on 2021-02-12 and released as a coordinated public advisory on 2021-06-25. Coordinated disclosure means the researcher and the vendor agree on when the details become public, usually after a fix is available. Credit goes to Mickey Jin (@patch1t) and Junzhi Lu (@pwn0rz) of Trend Micro.

Glossary

  • Framework: a reusable bundle of code that many applications share.
  • Library: code that other programs call on to perform a job.
  • Asset: a file of content, such as a 3D model, that an application loads.
  • USD: a file format for 3D scenes and models.
  • File format: an agreed arrangement of data inside a file so software can read it back.
  • Memory: the computer's working space where running programs keep data.
  • Allocated data structure: a block of memory a program has reserved for a purpose and may only read inside.
  • Out-of-bounds read: reading data outside the region a program was given.
  • Information disclosure: leaking data that should have stayed private.
  • CVSS: a standard scoring system for the severity of a security flaw.
  • Attack vector: the route by which a malicious file reaches a victim's machine.
  • Implementation: a particular application's own way of using a library.
  • Parsing: reading a file and turning its raw contents into something the program can use.
  • Proof of concept: a small demonstration that reliably triggers a bug.
  • Payload: the piece of data designed to cause an effect.
  • Process: a running program with its own private area of memory.
  • Execute arbitrary code: make the computer run instructions of the attacker's choosing.
  • Bounds check: a test that a position or length stays inside the allowed region before use.
  • Remote: carried out without the attacker being at the machine.
  • Offset: a number saying where something sits inside a file.
  • Length: a number saying how much data there is.
  • Memory sanitiser: a debugging tool that stops a program when it accesses memory outside the allowed region.
  • Heap: the part of memory a program uses for data it creates while running.
  • Chunked: split into labelled sections, each with its own size.
  • Recon: the early stage of looking around for targets and weak points.
  • Coordinated disclosure: researcher and vendor agreeing when details become public, usually after a fix.

More by Mickey Jin

View all

2 more disclosed reports, best first.

More from Zero Day Initiative

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.