-
Notifications
You must be signed in to change notification settings - Fork 20
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
Bugs found #36
Comments
Arbitrarily accessIn In In
|
Enclave OOB
Integer overflow
TaLoS/src/libressl-2.4.1/crypto/md32_common.h Lines 252 to 253 in 9c95998
Host OOB (Which can overflow to anywhere)In
In
In
Host OOB (Which overflow to redzone of ASan)Not importent, ignored |
Assert failIn |
TOCTOU (40)
TaLoS/src/libressl-2.4.1/crypto/asn1/x_name.c Lines 463 to 464 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/x509/x509_set.c Lines 71 to 75 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/evp/digest.c Lines 363 to 370 in 9c95998
Below are functions have same problem:
TaLoS/src/libressl-2.4.1/crypto/x509/x509_set.c Lines 117 to 119 in 9c95998
Below are functions have same problem:
TaLoS/src/libressl-2.4.1/crypto/bio/bio_lib.c Lines 366 to 377 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/ex_data.c Lines 529 to 530 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/bio/bio_lib.c Lines 301 to 317 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/x509/x509_cmp.c Lines 324 to 326 in 9c95998
TaLoS/src/libressl-2.4.1/ssl/ssl_lib.c Lines 874 to 875 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/bn/bn_print.c Lines 288 to 294 in 9c95998
TaLoS/src/libressl-2.4.1/ssl/ssl_cert.c Lines 324 to 327 in 9c95998
TaLoS/src/libressl-2.4.1/ssl/ssl_lib.c Lines 2735 to 2736 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/engine/eng_init.c Lines 138 to 143 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/ex_data.c Lines 632 to 634 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/asn1/tasn_fre.c Lines 202 to 220 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/ex_data.c Lines 606 to 623 in 9c95998
TaLoS/src/libressl-2.4.1/ssl/ssl_lib.c Lines 286 to 298 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/evp/p_lib.c Line 425 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/asn1/tasn_enc.c Lines 553 to 610 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/x509/x509_set.c Lines 107 to 109 in 9c95998
Below are functions have same problem:
TaLoS/src/libressl-2.4.1/crypto/bn/bn_lib.c Lines 397 to 399 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/asn1/a_int.c Lines 355 to 373 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/evp/pmeth_lib.c Lines 145 to 151 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/asn1/a_int.c Lines 355 to 373 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/asn1/asn1_lib.c Lines 439 to 442 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/evp/pmeth_lib.c Lines 378 to 379 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/asn1/x_pubkey.c Lines 149 to 151 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/asn1/tasn_enc.c Lines 632 to 643 in 9c95998
TaLoS/src/libressl-2.4.1/crypto/bio/bss_file.c Lines 173 to 174 in 9c95998
|
@LeoneChen Thank you for your contribution to this project and for raising the issues. However, this project is only a research prototype designed to easily inspect and modify protected data to run various experiments, not for production. It is also no longer actively maintained. |
Thanks for reply! I list bugs here to prevent other developers from making the same mistake. |
Null Pointer Dereference (NPD) (70)
In
ecall_OBJ_nid2sn
, invalidn
fed toOBJ_nid2sn
will cause NULL is returned tostr
(e.g. whenecall_OBJ_create
is not called before), and thenstrlen(str)
will crashIn
ecall_ENGINE_get_name
,ename
is obtained frome
, and can be null, thenstrlen
can crashIn
ecall_SSL_CIPHER_get_name
,ret
obtained fromc
can be null, thenstrlen(ret)
can crash.In
ecall_SSL_set_fd
, when ssl_hardening is never initialized before (get_ssl_hardening
not called before), thenm
obtained is newly created andm->count
is 0, cause outputin_s
with null inhashmapGet
, then inSSL_copy_fields_to_in_struct
,in->state
crashes. What's more,out_s
assigned with parameter can be null but without any check, thenout->state
crashes. Below are functions that have same problem:in_s
can be null, thenin_s->references
crash)Another simliar case is
ecall_SSL_set_info_callback
->SSL_copy_fields_to_out_struct
, invalidin_s
outputout_s
with null inhashmapGet
, thenout->state
crash. Below are functions that have same problem:In
ecall_BN_to_ASN1_INTEGER
->BN_to_ASN1_INTEGER
, whenbn
is null, BN_is_negative(bn) can crash.ecall_X509_get_ex_data
->X509_get_ex_data
->CRYPTO_get_ex_data
. Whenr
in ECALL is fed with null,ad
is 0x28, thenad->sk
cause NPD.ecall_SSL_CTX_get_client_CA_list
->SSL_CTX_get_client_CA_list
. Whenctx
is null,ctx->client_CA
crashes.ecall_X509_get_cert_key_algor_algorithm
->X509_get_cert_key_algor_algorithm
.x->cert_info->key->algor
can be null, thenx->cert_info->key->algor->algorithm;
cause NPD. Below are functions that have same problem:ecall_SSL_use_PrivateKey
->SSL_use_PrivateKey
->ssl_cert_inst
.ssl
inSSL_use_PrivateKey
can be null, theno
from&ssl->cert
is 0xf8, then*o == NULL
crash.ecall_SSL_set_connect_state
->SSL_set_connect_state
.s
can be null, thens->server = 0;
crash. Below are functions that have same problem:s->cert
inSSL_get_certificate
)s->cert
inSSL_get_privatekey
)s->handshake_func
inSSL_do_handshake
)ctx->cert_store
inSSL_CTX_get_cert_store
)x->cert_info
inX509_sign
)ctx
inSSL_CTX_get_verify_mode
)ctx
inSSL_CTX_set_default_passwd_cb
)ctx
inSSL_CTX_ctrl
)ctx
andctx->digest
inEVP_DigestFinal_ex
)X509_get_ext
inX509_get_ext
)ctx
inSSL_CTX_get_verify_callback
)a
inX509_get_subject_name
)e
inENGINE_get_name
)x->cert_info->key
inX509_pubkey_digest
->X509_get0_pubkey_bitstr
)server
inSSL_select_next_proto
,server[i]
)r->meth
inDH_free
)ctx
inSSL_CTX_sess_set_get_cb
)a
inBN_is_zero
)a
inBN_num_bits
)e
inENGINE_get_id
)p
is from*pp
which is one of ECALL parameters, ind2i_SSL_SESSION
->asn1_GetSequence
->ASN1_get_object
)s
inSSL_CTX_set_ex_data
, then&s->ex_data
is 0xd0,ad->sk
inCRYPTO_set_ex_data
crash)ecall_BN_dup
->BN_dup
->BN_copy
.A
is froma->d
and is null sincea
is newly allocated fromBN_new
. ThenA[0]
crashes. Wheni
smaller then 0,A[1]
crashes incase 3
,case 2
andcase 1
ecall_SSL_CTX_set_default_verify_paths
->SSL_CTX_set_default_verify_paths
.ctx
can be null, thenctx->cert_store
crashesecall_SSL_get_error
->SSL_get_error
->SSL_want_read
(SSL_want
).s
can be null, thens->rwstate
crashesecall_X509_check_issued
->X509_check_issued
->X509_NAME_cmp
->i2d_X509_NAME
->ASN1_item_i2d
->asn1_item_flags_i2d
->ASN1_item_ex_i2d
->ef->asn1_ex_i2d
->x509_name_encode
->BUF_MEM_grow
.str
can be null, thenstr->length
crashes.ecall_SSL_CTX_set_cipher_list
->SSL_CTX_set_cipher_list
.ctx
can be null, thenctx->method
crashesecall_SSL_CTX_set_default_verify_paths
->SSL_CTX_set_default_verify_paths
->X509_STORE_set_default_paths
->X509_STORE_add_lookup
->sk_X509_LOOKUP_push
(sk_push
)->sk_insert
.st->data
can be null,st->data[st->num]
crashesecall_X509_digest
->X509_digest
->ASN1_item_digest
->ASN1_item_i2d
->asn1_item_flags_i2d
->ASN1_item_ex_i2d
->asn1_template_ex_i2d
->ASN1_item_ex_i2d
->asn1_template_ex_i2d
->ASN1_item_ex_i2d
->asn1_i2d_ex_primitive
->asn1_ex_i2c
.pf
can be null, thenpf->prim_i2c
crashesecall_EC_KEY_free
->EC_KEY_free
->EC_GROUP_free
.group
ecall_SSL_CTX_use_PrivateKey_file
->SSL_CTX_use_PrivateKey_file
->BIO_new
->execute_bio_ocall_malloc
->bio_alloc_from_pool
. When first callget_bio_mempool
,m_memStart
of returnedpool
is 0, then inpool_alloc
,AddrFromIndex
returnp
with null, then*p
crashesecall_X509_set_ex_data
->X509_set_ex_data
->CRYPTO_set_ex_data
->sk_void_set
(sk_set
).st->data
can be null.The text was updated successfully, but these errors were encountered: