Описание
MaterialX Lack of MTLX Import Depth Limit Leads to DoS (Denial-Of-Service) Via Stack Exhaustion
Summary
Nested imports of MaterialX files can lead to a crash via stack memory exhaustion, due to the lack of a limit on the "import chain" depth.
Details
The MaterialX specification supports importing other files by using XInclude tags.
When parsing file imports, recursion is used to process nested files in the form of a tree with the root node being the first MaterialX files parsed.
However, there is no limit imposed to the depth of files that can be parsed by the library, therefore, by building a sufficiently deep chain of MaterialX files one referencing the next, it is possible to crash the process using the MaterialX library via stack exhaustion.
PoC
This test is going to employ Windows UNC paths, in order to make the Proof Of Concept more realistic. In fact, by using windows network shares, an attacker would be able to exploit the vulnerability (in Windows) if they could control the content of a single .mtlx file being parsed.
Note that for the sake of simplicity the PoC will use the MaterialXView application to easily reproduce the vulnerability, however it does not affect MaterialXView directly.
In order to reproduce this test, please follow the steps below:
- Compile or download the MaterialXView application in a Windows machine
- In a separate Linux machine in the same local network, install the
impacketpackage (the documentation of the package suggests usingpipx, as inpython3 -m pipx install impacket). - In the Linux machine, create a file named
template.mtlxwith the following content:
- In the same directory, create a file named
script.pywith the following content:
- Run the python script with the following command line, replacing the
$IPplaceholder with the IP address of your interface (the command will take some time to execute):python3 script.py --iterations 1048576 template.mtlx chain $IP chain- This will print, in the console, a line documenting the UNC path of the first file of the chain. Copy that path in the clipboard.
- Spawn the SMB server by executing the following command line:
pipx run --spec impacket smbserver.py -smb2support chain chain/ - In the Windows machine, create a MaterialX file with the following content, replacing the
$UNCPATHplaceholder with the content of the path printed at step 5:
- Load the MaterialX file in MaterialXView
- Notice that the viewer doesn't respond anymore. After some minutes, notice that the viewer crashes, demonstrating the Stack Exhaustion
Note: by consulting the Windows Event Viewer, it is possible to examine the application crash, verifying that it is indeed crashing with a STATUS_STACK_OVERFLOW (0xc00000fd).
Impact
An attacker exploiting this vulnerability would be able to intentionally stall and crash an application reading MaterialX files controlled by them.
In Windows, the attack complexity is lower, since the malicious MaterialX file can reference remote paths via the UNC notation. However, the attack would work in other systems as well, provided that the attacker can write an arbitrary amount of MaterialX files (implementing the chain) in the local file system.
Ссылки
- https://github.com/AcademySoftwareFoundation/MaterialX/security/advisories/GHSA-qc2h-74x3-4v3w
- https://nvd.nist.gov/vuln/detail/CVE-2025-53012
- https://github.com/AcademySoftwareFoundation/MaterialX/pull/2233/commits/6182c07467297416a30d148ab531d81198686dc5
- https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/documents/Specification/MaterialX.Specification.md#mtlx-file-format-definition
- https://github.com/AcademySoftwareFoundation/MaterialX/releases/tag/v1.39.3
Пакеты
MaterialX
= 1.39.2
1.39.3
Связанные уязвимости
MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers. In version 1.39.2, nested imports of MaterialX files can lead to a crash via stack memory exhaustion, due to the lack of a limit on the "import chain" depth. When parsing file imports, recursion is used to process nested files; however, there is no limit imposed to the depth of files that can be parsed by the library. By building a sufficiently deep chain of MaterialX files one referencing the next, it is possible to crash the process using the MaterialX library via stack exhaustion. This is fixed in version 1.39.3.