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

leak information due to uninitializatized memory #8

Open
jmp0x7c00 opened this issue Mar 16, 2022 · 0 comments
Open

leak information due to uninitializatized memory #8

jmp0x7c00 opened this issue Mar 16, 2022 · 0 comments

Comments

@jmp0x7c00
Copy link

Hi,sir,
I think there is a security issue here,could you help me confirm it?
in sqlite.c:

if( m!=0 ){
      struct stat statbuf; // statbuf is not initializatized,which may exist some sensitive data
      if( osFstat(fd, &statbuf)==0 // when osFstat is invoked , the ocall  ocall_stat will be invoked later
       && statbuf.st_size==0
       && (statbuf.st_mode&0777)!=m
      ){
        osFchmod(fd, m);
      }
    }

in edl:
int ocall_stat([in, string] const char *path, [in, out, size=size] struct stat *buf, size_t size); , because buf is in, the original data in buf will be copied out of the Enclave , which leads to an information leakage.

solution:
memset statbuf to zero before invoke osFstat or remove in flag in edl

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

No branches or pull requests

1 participant