cve/2023/CVE-2023-41325.md
2024-06-18 02:51:15 +02:00

18 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### [CVE-2023-41325](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-41325)
![](https://img.shields.io/static/v1?label=Product&message=optee_os&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=%3D%20%3E%3D%203.20%2C%20%3C%203.22%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-415%3A%20Double%20Free&color=brighgreen)
### 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.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 optees 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.
### POC
#### Reference
- https://github.com/OP-TEE/optee_os/security/advisories/GHSA-jrw7-63cq-7vhm
#### Github
No PoCs found on GitHub currently.