{"id":"CVE-2023-41325","aliases":["CVE-2023-41325"],"related":[],"kind":"vulnerability","state":"published","title":"OP-TEE double free in shdr_verify_signature","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"es","text":"OP-TEE es un Entorno de Ejecución Confiable (TEE) diseñado como complemento de un kernel de Linux no seguro que se ejecuta en Arm; Núcleos Cortex-A que utilizan la tecnología TrustZone. A partir de la versión 3.20 y anteriores a la versión 3.22, `shdr_verify_signature` puede hacer un doble libremente. `shdr_verify_signature` se usa para verificar un binario TA antes de cargarlo. Para verificar una firma del mismo, asigne una memoria para la clave RSA. La función de asignación de clave RSA (`sw_crypto_acipher_alloc_rsa_public_key`) intentará asignar una memoria (que es la memoria del montón del candidato). La clave RSA consta de exponente y módulo (representados como variables `e`, `n`) y su asignación no es de forma atómica, por lo que puede tener éxito en `e` pero fallar en `n`. En este caso, sw_crypto_acipher_alloc_rsa_public_key` se liberará en `e` y regresará cuando falló, pero la variable “e” permanece como dirección de memoria ya liberada. `shdr_verify_signature` liberará nuevamente esa memoria (que es `e`), incluso si se libera cuando no se pudo asignar la clave RSA. Hay un parche disponible en la versión 3.22. No hay workarounds conocidos disponibles.","source":"nvd"}],"published":"2023-09-15T19:40:58.065Z","modified":"2026-06-17T06:21:47.243Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":6.7,"rating":"MEDIUM"}],"cwes":["CWE-415"],"affected":[{"ranges":[{"version":">= 3.20, < 3.22","status":"affected"}],"vendor":"OP-TEE","product":"optee_os","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"3.20.0","fixed":"3.22.0"},{"status":"affected","version":"3.22.0"}],"vendor":"trustedfirmware","product":"op-tee","cpe":"cpe:2.3:o:trustedfirmware:op-tee:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/OP-TEE/optee_os/security/advisories/GHSA-jrw7-63cq-7vhm","tags":["exploit","vendor-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/OP-TEE/optee_os/commit/e2ec831cb07ed0099535c7c140cb6338aa62816a","tags":["patch","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2024-09-25T18:48:57.951Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-41325","url":"https://www.cve.org/CVERecord?id=CVE-2023-41325","licence":"CVE Terms of Use","modified":"2024-09-25T18:49:09.428Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-41325","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-41325","licence":"Public domain","modified":"2026-06-17T06:21:47.243Z"}],"updatedAt":"2026-11-25T22:58:27.947Z","epss":{"score":0.00386,"percentile":0.34766,"date":"2026-12-02T12:00:21.000Z"}}