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

Fix code scanning alert no. 1: Use of insecure SSL/TLS version #25

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

andreasgriffin
Copy link
Owner

Fixes https://github.com/andreasgriffin/bitcoin-safe/security/code-scanning/1

To fix the problem, we need to ensure that the SSL context explicitly disallows insecure TLS versions and only allows TLS 1.2 or higher. This can be done by setting the minimum_version attribute of the SSL context to ssl.TLSVersion.TLSv1_2.

The best way to fix the problem without changing existing functionality is to modify the SSL context creation in the get_electrum_server_version function. Specifically, we will set the minimum_version attribute of the context to ssl.TLSVersion.TLSv1_2 right after creating the context with ssl.create_default_context().

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@andreasgriffin andreasgriffin marked this pull request as ready for review November 9, 2024 18:21
@andreasgriffin andreasgriffin merged commit b1c54d8 into main Nov 9, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

1 participant