Skip to content

potential security issue: ecall_SSL_write using [user_check] #13

@jxjlearn

Description

@jxjlearn

public int ecall_SSL_write([user_check] SSL *ssl,[user_check] const void *buf,int num);

This edl definition uses [user_check] for pointer argument "const void *buf". It introduces the vulnerability to allow attackers to retrieve the secret info inside enclave, because SGX boundary check has been skipped for this pointer.

Potential attack methodology: with help of another ecall function, ecall_SSL_read, one can pass a pointer pointing an address inside SGX enclave to ecall_SSL_write, then use ecall_SSL_read to read the content of enclave through SSL communication.

The simple fix will be to change edl attribute for "const void *buf" in ecall_SSL_write from [user_check] to [in], or to add boundary-checking code in the applications, such as using SGX-provided function "sgx_is_outside_enclave" like here.

Please feel free to contact me if you want to discuss this issue, and I can explain it more by demonstrating a POC exploring this vulnerability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions