Skip to content

[Security] Use after free in enclave #2

@mustakimur

Description

@mustakimur

ecall_closedb() must set db pointer to NULL after free the object.

void ecall_closedb(){
    sqlite3_close(db);
    db = NULL; // change
    ocall_println_string("Enclave: Closed database connection");
}

Otherwise a check like:

  if (db == 0){
     return ERR;
  }
  magic = db->magic_byte;

will fail from multiple places.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions