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

Memory leak in set0_trusted_stack and set0_untrusted #90

Open
sconway-datto opened this issue May 1, 2022 · 1 comment
Open

Memory leak in set0_trusted_stack and set0_untrusted #90

sconway-datto opened this issue May 1, 2022 · 1 comment

Comments

@sconway-datto
Copy link

Continuing the conversation from this SSLyze issue:
nabla-c0d3/sslyze#560

In the following comment, I showed a simple test script that would illustrate that the nassl functions set0_trusted_stack and set0_untrusted appear to have memory leaks. Run as-is, the script will provide empty lists to both functions and leak memory.

nabla-c0d3/sslyze#560 (comment)

@nabla-c0d3
Copy link
Owner

nabla-c0d3 commented Nov 6, 2022

SSLyze is going to switch to pyOpenSSL for path validation (nabla-c0d3/sslyze#566) so the leaky code will not be used by SSLyze anymore. This is a comment I had put for troubleshooting the memory leak in nassl:

# TODO(AD): There is probably a memory leak in nassl.X509 or nassl.X509_STORE_CTX
#  https://github.com/nabla-c0d3/sslyze/issues/560
#  It might be due to bad reference counting in nassl_X509_STORE_CTX_set0_trusted_stack()
#  More specifically the call to X509_chain_up_ref() - is there corresponding call to decrease ref count?
#  As a workaround, we cache the (huge) list of trusted certificates, for each trust store

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

2 participants