Dissecting the Apple Neural Engine
Latest materials
- Open up, that's an order
The PT ESC cyber threat intelligence team has discovered the exploitation of CVE-2026-21513 in attacks on…
- BECna: very malicious things
The PT ESC Threat Intelligence team has recorded mass BEC attacks against Russia using the BoryptGrab…
- Heap-based buffer overflow in ntfs!AnalysisPass
A heap buffer overflow exists in the ntfs!AnalysisPass functionality of Microsoft Windows NTFS driver. During recovery…
- Another super-duper vulnerability threatens the whole world
On October 21, two critical PHP vulnerabilities were disclosed — CVE-2026-109618 and CVE-2026-109619, both with a…
- Out-of-bounds write in ntfs!PageUpdateAnalysis
A heap buffer overflow vulnerability exists in the ntfs!PageUpdateAnalysis function of the Microsoft Windows NTFS driver.…
Introduction
On modern Apple devices, a substantial share of compute logic and performance optimizations is offloaded to coprocessors, and AI workloads are no exception: they are handled by the Apple Neural Engine (ANE).
Coprocessor-facing attack surfaces are particularly interesting to security researchers because these subsystems often introduce more trust boundaries and can exhibit lower code quality than the rest of the system. Real-world exploit chains reinforce this observation: coprocessor vulnerabilities regularly appear in in-the-wild chains – for example, the M2Scaler sandbox escape used by DarkSword and the “Rocket” SPTM bypass from Coruna.
In this article, we will walk through the architecture of the Apple Neural Engine, map the current attack surface exposed to a third-party iOS application, and examine one of several vulnerabilities uncovered during the audit: CVE-2026-43748.
Apple Neural Engine Overview
The Apple Neural Engine is an NPU integrated into modern Apple Silicon SoCs, designed primarily for energy-efficient machine-learning workloads.
For developers, ANE is one of several CoreML compute backends, alongside the CPU and GPU. CoreML automatically selects an appropriate backend based on the model (not every model can run on ANE), the capabilities of the device, and the configured MLComputeUnits.
ANE does not execute the model’s source representation directly. Instead, before execution, the model goes through an additional compilation stage that produces a hardware-specific representation for a particular Neural Engine generation. Depending on the stage of model adaptation, four formats can be distinguished:

mlmodel and mlpackage – the original model formats. A model in either format can be produced by converting a PyTorch or TensorFlow representation with coremltools.
mlmodelc – a package produced after the initial adaptation performed by the CoreML.framework. It contains an intermediate representation of the model, the model.mil. From an attacker’s perspective, an arbitrary mlmodelc package can be supplied to the system. Accordingly, the format is treated as untrusted and is extensively validated by both CoreML and the relevant services.MIL itself has a fairly complex grammar, much of which is documented by coremltools.This makes it a particularly interesting input surface for fuzzing ANECompilerService.

net.plist – the result of specializing an mlmodelc model within ANECompilerService. Actually not interesting from an attacker perspective.
hwx – the binary output produced by translating net.plist. It is a Mach-O file containing a task descriptor list executed by the ANE firmware. This binary is being loaded by driver to ANE. But the system does not allow an arbitrary hwx to be loaded: it verifies that the model originates from a Cryptex or a trusted path (/Library/Caches/com.apple.aned/*). The code also contains traces of a check that the model’s signature is present in the trust cache, although that check is disabled as of iOS 27.

At a high level, the ANE architecture can be summarized as follows: the kernel-side interaction logic resides in the com.apple.driver.AppleH11ANEInterface driver, while the main user-space actors are the aned daemon’s XPC services – com.apple.appleneural.engine and com.apple.appleneural.engine.private – together with services associated with AppleNeuralEngine.framework, including com.apple.ANECompilerService.
The primary public entry point into this subsystem for applications is CoreML.framework, which hides most interaction with the ANE behind a high-level API.

In principle, any of these components can become an entry point depending on the attacker’s context. Here, however, we will focus on which kernel-facing interfaces are reachable from a third-party application running in the default sandbox.
Apple Neural Engine’s attack surface
For IOKit-based drivers, the primary entry points are typically subclasses of IOService and IOUserClient. Of particular interest are overridden newUserClient methods, which usually validate the caller’s entitlements and select the client type, and externalMethod, which dispatches functions according to the supplied selector.

com.apple.driver.AppleH11ANEInterface defines at least three meaningful IOUserClient-related classes: H11ANEInUserClient (main path), H11ANEInDirectPathClient (direct path), and ANEClientHintsUserClient (hints path). Together, they expose roughly 20 unique selectors.
It is also worth noting that XNU invokes hooks from the MACF framework during is_io_service_open_extended and is_io_connect_method. Sandbox.kext is one of the primary policy providers for these MACF checks.

On iOS, this means that the sandbox profile of the application – or of a service we intend to use as a confused deputy – must permit opening both the service and the corresponding client. A third-party application running under container.sb is allowed to open only H11ANEInDirectPathClient, not H11ANEInUserClient.

H11ANEInUserClient, in turn, is reachable only from the aned sandbox context, while ANEClientHintsUserClient is available from system-service contexts such as handwritingd.

However, aned exposes not only the entitlement-protected XPC service c.a.appleneuralengine.private, but also c.a.appleneuralengine, which is open to third-party clients. As a result, H11ANEInUserClient can be considered partially reachable as well, albeit behind additional user-space validation.

In addition to system-wide policy checks, the driver performs its own validation. When the main or direct path is opened, it checks whether the client holds the com.apple.ane.iokit-user-access entitlement.

If the entitlement is absent, initialization of the main path is subsequently denied. The hints path performs a similar check, using a different entitlement – com.apple.private.ane.allow-set-client-hints. Notably, the direct path itself remains unchecked by the driver.

Putting these checks together, only the direct-path methods are reachable from the default application sandbox with full control over their arguments and without additional validation by user-space services.

Dissecting CVE-2026-43748
As said before, auditing the direct-path selectors revealed several issues, but one in particular deserves closer attention: an out-of-bounds write in ANE direct path, assigned CVE-2026-43748. At its core, ANE_ProgramCheckandPrewireBuffers_gated allocates room for 0x80 buffer descriptors, while ANE_ProgramSendRequest permits up to 0xff IOSurfaces in total. Let us examine the root cause in more detail:
Root-cause analysis
The vulnerable selector is exposed through H11ANEInDirectPathClient (H1xANELoadBalancerDirectPathClient), identified in the attack-surface analysis above. When the client is created, clientKind is set to kANEClientKindDirectPath. For ANE_ProgramSendRequest, the usual IOKit access and data-chaining checks are not required.

ANE_ProgramSendRequest accepts a fairly large structured input. Among other fields, it includes the IOSurfaces used for model inputs and outputs, their symbol indices, and the associated buffer counts. After a small amount of initial validation, the selector forwards the request to ANEClientDevice::programSendRequest.

ANEClientDevice::programSendRequest is essentially a thin adapter that forwards the call to the provider’s ANE_ProgramSendRequest method.

The first meaningful validation occurs in ANEHWDevice::ANE_ProgramSendRequest. The function starts by checking whether adding totalInputBuffers and totalOutputBuffers would overflow.

It then requires both counts to be non-zero and ensures that their sum stays below 0x100.

Once these checks succeed, the driver resolves each supplied surface ID via IOSurfaceRoot::lookupSurface and stores the resulting objects in separately allocated input and output arrays.

The request eventually enters the gated path:

ANE_ProgramSendRequestInitialChecksAndLookups_gated validates the IOSurfaces and their protection settings, reconciles the input and output counts with the procedure being executed, and finally validates the aggregate buffer count, including weights:

The corresponding error message names 0xff as kANEMaxBuffers. In practical terms, a request is allowed to contain up to 0xff buffers in total.

That upper bound does not match the allocation later made by ANEHWDevice::ANE_ProgramCheckandPrewireBuffers_gated.
This function creates memoryMapRequest, a descriptor table used to prewire the supplied IOSurfaces. _IOMallocTypeImpl allocates only 0x820 bytes for this object, placing it in the data.kalloc.3072 zone.

Reconstructing the structure makes the intended capacity clear: 0x800 bytes are reserved for 0x80 entries of 0x10 bytes each, while the remaining 0x20 bytes store request metadata.

This is where the logic breaks down. Immediately after the allocation, the driver begins populating entries without first verifying that the supplied count fits the table. The loop below writes one descriptor for each input surface; a nearly identical loop processes the outputs afterward.

Every entry beyond index 0x7f is therefore written out of bounds. Since the earlier validation allows as many as 0xff buffers, the maximum overwrite is approximately:
(0xff – 0x80) * 0x10 = 0x7f0 bytes
The initial out-of-bounds writes first overwrite the request’s own metadata and then the allocator padding. At index 0xc0, the destination reaches offset 0xc00:
0xc0 * 0x10 = 3072
At that point, the write crosses into the next data.kalloc.3072 chunk. The panic triggered by the PoC confirms the memory corruption:

The values observed in the adjacent freed chunk match the descriptor layout produced by the loop: surfaceId = 0x18e, symbolIndex = 0xc0, followed by mapFlags and direction.

The driver does, in fact, contain the correct bufferCount < 0x80 check. The problem is that it is applied too late, inside ANEHWDevice::ANE_MemoryMapRequest_gated, after the descriptor-building loops have already corrupted memory.

Ultimately, the vulnerability is caused by two closely related mistakes:
- kANEMaxBuffers permits up to 0xff buffers, whereas memoryMapRequest can hold only 0x80 entries.
- The check against the table’s actual capacity is performed after the writes rather than before them.
PoC analysis
With the root cause established, the iOS PoC demonstrates the issue without opening the ANE user client directly. Instead, it relies on a Core ML model whose shape is chosen specifically to reach the driver’s maximum accepted buffer count: 254 scalar inputs and a single output.

The app loads the bundled XVRC27_254in_1out_addchain model with MLComputeUnitsAll, allowing Core ML to schedule it on ANE:

Then run_coreml_inference creates one MLMultiArray for every input, named x_000 through x_253.

And evaluates the model through predictionFromFeatures.

At this point panic caused by out-of-bounds write should be observed if PoC is being run on iPhone Air (because of MTE violation).
Disclosure Timeline
- 6/25/26 The vendor was notified of the vulnerability and provided with a technical report.
- 7/13/26 The vendor completed its internal triage and confirmed the vulnerability.
- 7/27/26 Security updates were released and the advisory was published for macOS.
- 9/14/26 Advisory was updated with according credit for iOS security release.
Latest materials
- Open up, that's an order
The PT ESC cyber threat intelligence team has discovered the exploitation of CVE-2026-21513 in attacks on…
- BECna: very malicious things
The PT ESC Threat Intelligence team has recorded mass BEC attacks against Russia using the BoryptGrab…
- Heap-based buffer overflow in ntfs!AnalysisPass
A heap buffer overflow exists in the ntfs!AnalysisPass functionality of Microsoft Windows NTFS driver. During recovery…
- Another super-duper vulnerability threatens the whole world
On October 21, two critical PHP vulnerabilities were disclosed — CVE-2026-109618 and CVE-2026-109619, both with a…
- Out-of-bounds write in ntfs!PageUpdateAnalysis
A heap buffer overflow vulnerability exists in the ntfs!PageUpdateAnalysis function of the Microsoft Windows NTFS driver.…







