HarborGuardharborguardDatabase
Back to search
HIGHCVE-2026-40290Published Modified CNA GitHub_M

CVE-2026-40290: OP-TEE has a Use-After-Free race in FF-A shared-memory teardown

OP-TEE is a Trusted Execution Environment (TEE) designed as companion to a non-secure Linux kernel running on Arm; Cortex-A cores using the TrustZone technology. Starting in version 3.16.0 and prior to 4.11.0, a user-after-free (UAF) race condition exists in the shared memory teardown logic of FF-A within OP-TEE SPMC/SP flows. This only applies when OP-TEE is configured as an SPMC for S-EL0 SPs, that is, with `CFG_SECURE_PARTITION=y`. The function `sp_mem_remove()`, responsible for freeing entries in `smem->receivers` and `smem->regions`, fails to acquire the global `sp_mem_lock` before performing the `free()` operations. Concurrently, other code paths, such as `sp_mem_get_receiver()`, iterate over these same lists without holding a lock, or, like `sp_mem_is_shared()`, iterate while holding the lock but are not serialized against the unprotected `free()` in `sp_mem_remove()`. This creates a cross-thread race where a thread iterating the list can acquire a pointer to an entry (e.g., `struct sp_mem_map_region` or `struct sp_mem_receiver`), and then another thread calls `sp_mem_remove()`, freeing the object. When the first thread resumes and dereferences the pointer, it results in a Use-After-Free vulnerability. Version 4.11.0 fixes the issue.

Metrics

CVSS v3.1
7.8
Severity
HIGH
Fixed in
Affected Products
1

Get notified

Email me when this CVE is updated: new fix versions, severity changes, or any record change.

HarborGuard Analysis

Synopsis

A use-after-free race condition exists in OP-TEE (optee_os), the open-source Trusted Execution Environment for Arm TrustZone, affecting versions 3.16.0 through 4.10.x. The flaw lives in the FF-A shared-memory teardown path and is reachable by a local attacker with a low-privilege account on the host; no network access or user interaction is needed. Successful exploitation gives the attacker full read, write, and execution control within the TEE context, enabling secret disclosure, data tampering, and service disruption. No fix has been published upstream yet; HarborGuard tracks the advisory and will make a patched-image rebuild available the moment a fix version is released.

HarborGuard Coverage

Detection

Detection for CVE-2026-40290 is available across every HarborGuard environment: the CVE is ingested from upstream feeds within minutes of publication and matched against all customer images, including custom-built images that bundle optee_os. Any image carrying an affected optee_os version in the range 3.16.0 to 4.10.x will surface a finding immediately.

Available
Triage

HarborGuard is capable of scoring this finding at CVSS 7.8 HIGH (v3.1) and weighting it further against each customer's per-environment compliance policy to route the alert to the appropriate team inbox. Triage enrichment includes the specific affected version range, the build-time configuration flag (CFG_SECURE_PARTITION=y) that governs exploitability, and severity context for prioritization.

Available
Patch

Because no fix version has been published upstream, HarborGuard re-checks the advisory on every ingest cycle and will make a patched-image rebuild available automatically the moment version 4.11.0 or a later fix is confirmed upstream. For customers with auto-remediation enabled, that rebuild will trigger a regression run and a PR opened against affected workloads without manual intervention.

Pending upstream

Exploit Conditions

  • Network reachabilityNot required

    The attacker needs an existing shell or process on the host; the vulnerable code path is not reachable over the network.

  • AuthenticationRequired

    Any low-privilege local account is sufficient to reach the FF-A shared-memory teardown path; no elevated or admin credentials are needed.

  • Victim interactionNot required

    No user interaction is required; the attacker triggers the race entirely through their own process actions.

  • Attack complexityDetail

    Attack complexity is rated Low, meaning the race condition can be triggered reliably without depending on specific memory layouts, timing windows, or other environmental preconditions beyond having a local process running concurrently.

Blast Radius

  • A successful attacker reads memory belonging to the Trusted Execution Environment, exposing cryptographic keys, secure credentials, and any secrets processed inside TrustZone-backed trusted applications.
  • The attacker writes to freed memory structures (struct sp_mem_map_region or struct sp_mem_receiver), allowing corruption of TEE internal state and manipulation of secure-world data.
  • Corrupted internal list structures crash the OP-TEE SPMC, taking down the secure partition manager and any S-EL0 secure partitions that depend on it.
  • Because all three impact dimensions (confidentiality, integrity, availability) score High, the attacker gains full compromise of the secure-world context on the affected core.

How HarborGuard Handles This

Available on HarborGuard: detection for this CVE is active and will flag any image containing optee_os 3.16.0 through 4.10.x the moment it appears in a customer registry or pipeline scan. Because no upstream fix exists yet, the patched-image rebuild flow is on standby; HarborGuard re-evaluates the advisory on every ingest cycle and will initiate a rebuild automatically when version 4.11.0 is confirmed. For customers who opt into auto-remediation, the rebuild, regression run, and PR against affected workloads will follow without manual steps. In the interim, compensating controls worth considering include network-policy isolation of workloads that mount the TEE interface, restricting which container images are permitted to include optee_os via compliance policy rules in HarborGuard, and auditing builds for the CFG_SECURE_PARTITION=y flag since the vulnerable code path is only active when OP-TEE is configured as an SPMC for S-EL0 SPs.

See how HarborGuard automates this
Affected packages
  • OP-TEE / optee_os
    >= 3.16.0, < 4.11.0
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H