{"answers":{"affected":"It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40290 exists.","fix":"No fix has been published for CVE-2026-40290 yet. Limit exposure of the affected software until one is available.","what":"CVE-2026-40290 is a high-severity use after free vulnerability in OP-TEE optee_os, published on 3 Jun 2026. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-40290 and fix it if it is affected.\n\nWhat it is: CVE-2026-40290 is a high-severity use after free vulnerability in OP-TEE optee_os, published on 3 Jun 2026. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40290 exists.\n\nAffected product: OP-TEE optee_os. No package-level version data is available, so check the vendor advisory linked from the reference page.\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-40290/ (Markdown: https://insights.sbomify.com/CVE-2026-40290/index.md)","id":"CVE-2026-40290","markdown":"https://insights.sbomify.com/CVE-2026-40290/index.md","name":"CVE-2026-40290","record":{"aliases":["DEBIAN-CVE-2026-40290","GHSA-332c-xr93-849m","UBUNTU-CVE-2026-40290"],"analysis":{"component_type":"operating_system","fix_type":"upgrade","impacts":["code_execution","privilege_escalation"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"OP-TEE Trusted Execution Environment","requires_auth":"low_privilege","summary":"A race condition in OP-TEE's shared memory teardown allows attackers to trigger a use-after-free, potentially leading to code execution or privilege escalation in the Trusted Execution Environment.","user_interaction":"not_required","vuln_class":"use_after_free"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"op-tee","vendor":"trustedfirmware"}],"cvss":{"score":7.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"description":"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-\u003ereceivers` and `smem-\u003eregions`, 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.","ecosystems":[],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":false,"headline":"OP-TEE has a Use-After-Free race in FF-A shared-memory teardown","id":"CVE-2026-40290","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":null,"product":null,"products":[],"type":"use_after_free","year":"2026"},"n_packages":0,"n_references":1,"next":{"headline":"Chamilo LMS has Privilege Escalation via API User Role Modification","id":"CVE-2026-40291"},"packages":[],"prev":{"headline":"PraisonAI Browser Server allows unauthenticated WebSocket clients to hijack connected extension sessions","id":"CVE-2026-40289"},"products":["optee_os"],"published":"2026-06-03","related":[{"cvss_score":9.8,"headline":"Memory corruption in OP-TEE","id":"CVE-2019-1010292","kev_date_added":null,"published":"2019-07-16"},{"cvss_score":9.8,"headline":"Memory corruption in OP-TEE","id":"CVE-2019-1010293","kev_date_added":null,"published":"2019-07-15"},{"cvss_score":9.8,"headline":"Linaro/OP-TEE OP-TEE 3.3.0 and earlier is affected by: Buffer Overflow.","id":"CVE-2019-1010295","kev_date_added":null,"published":"2019-07-15"},{"cvss_score":9.8,"headline":"Memory corruption in OP-TEE","id":"CVE-2019-1010296","kev_date_added":null,"published":"2019-07-15"},{"cvss_score":9.8,"headline":"Memory corruption in OP-TEE","id":"CVE-2019-1010297","kev_date_added":null,"published":"2019-07-15"},{"cvss_score":9.8,"headline":"Memory corruption in OP-TEE","id":"CVE-2019-1010298","kev_date_added":null,"published":"2019-07-15"},{"cvss_score":9.1,"headline":"Information disclosure in n/a","id":"CVE-2019-25052","kev_date_added":null,"published":"2021-08-11"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-06-04","vendors":["OP-TEE"]},"summary":"A race condition in OP-TEE's shared memory teardown allows attackers to trigger a use-after-free, potentially leading to code execution or privilege escalation in the Trusted Execution Environment.","url":"https://insights.sbomify.com/CVE-2026-40290/"}