{"id":"CVE-2023-41325","published":"2023-09-15T19:40:58Z","modified":"2024-09-25T18:49:09Z","title":"OP-TEE double free in shdr_verify_signature","vendor":"OP-TEE","product":"optee_os","tier":"tail","description":{"text":"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.20 and prior to version 3.22, `shdr_verify_signature` can make a double free. `shdr_verify_signature` used to verify a TA binary before it is loaded. To verify a signature of it, allocate a memory for RSA key. RSA key allocate function (`sw_crypto_acipher_alloc_rsa_public_key`) will try to allocate a memory (which is optee’s heap memory). RSA key is consist of exponent and modulus (represent as variable `e`, `n`) and it allocation is not atomic way, so it may succeed in `e` but fail in `n`. In this case sw_crypto_acipher_alloc_rsa_public_key` will free on `e` and return as it is failed but variable ‘e’ is remained as already freed memory address . `shdr_verify_signature` will free again that memory (which is `e`) even it is freed when it failed allocate RSA key. A patch is available in version 3.22. No known workarounds are available.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.4,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00386,"percentile":0.33532,"provenance":"source"},"cwes":[{"id":"CWE-415","name":"Double Free"}],"references":[{"url":"https://github.com/OP-TEE/optee_os/security/advisories/GHSA-jrw7-63cq-7vhm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/OP-TEE/optee_os/commit/e2ec831cb07ed0099535c7c140cb6338aa62816a","tags":["x_refsource_MISC"]}],"priority":{"score":11.9,"factors":[{"name":"EPSS percentile","points":6.71},{"name":"CVSS severity","points":5.18}]},"vendorSlug":"op-tee","affectedVersions":[{"vendor":"OP-TEE","product":"optee_os","versions":[">= 3.20, < 3.22"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2024-09-25T18:48:57.951686Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2023-45838","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-linaro-op-tee-op-tee-cve-2019-1010297","parents":[{"from":"CVE-2019-1010297","to":"CVE-2023-41325","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["core/tee/tee_svc_cryp.c"],"commits":["https://github.com/OP-TEE/optee_os/commit/a637243270fc1faae16de059091795c32d86e65e","https://github.com/OP-TEE/optee_os/commit/e2ec831cb07ed0099535c7c140cb6338aa62816a"],"basis":"shared function","functions":["syscall_cryp_derive_key"]}]}]}}