Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security: Improper Input Validation in the function utee_cryp_obj_alloc #83

Closed
c01dkit opened this issue Sep 16, 2022 · 0 comments · Fixed by #88
Closed

Security: Improper Input Validation in the function utee_cryp_obj_alloc #83

c01dkit opened this issue Sep 16, 2022 · 0 comments · Fixed by #88

Comments

@c01dkit
Copy link

c01dkit commented Sep 16, 2022

Affected components:

affected source code file: /tee/tee/tee_svc_cryp.c, affected functions: utee_cryp_obj_alloc
affected source code file: /tee/tee/tee_obj.c, affected functions: tee_obj_alloc and tee_obj_free

Attack vector(s)

One way to exploit the vulnerability, invoking the function TEE_AllocateOperation and TEE_Realloc with a large size to disturb the heap layout, and invoke TEE_AllocateOperation again.

Suggested description of the vulnerability for use in the CVE

Improper Input Validation vulnerablity in the function tee_obj_free in Samsung Electronics mTower v0.3.0 (and earlier) allows a trusted application to trigger a Denial of Service (DoS) via invoking the function TEE_AllocateOperation with a disturbed heap layout.

Discoverer(s)/Credits

SyzTrust

Reference(s)

https://github.com/Samsung/mTower

TEE_Result utee_cryp_obj_alloc(unsigned long obj_type,

free(o->attr);

Additional information

As shown in POC, the calloc function in tee_obj_alloc does not return a buffer with all bits zero as expected when the heap layout was disturbed in mTower on a real IoT hardware (such as Numaker-PFM-M2351). Executing the statement free(o->attr) then will free an invalid pointer, which will crash the trusted execution environment kernel and cause a Denial of Service (DoS).

PoC

poc_14.zip

THANK YOU FOR CONTRIBUTIONS IN MTOWER TEE OS!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant