Revisit certificate identity verification in OpenSSL::SSL
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 8/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- cryptography, networking, security
Hướng nghiên cứu
Start with the three entry points named in the issue and the current implementation in lib/openssl/ssl.rb around lines 293-375. Read RFC 9525 and the linked PR #12 before deciding whether to remove partial wildcards and CN fallback, and whether to delegate to OpenSSL X509_VERIFY_PARAM or X509_check_host/X509_check_ip. This is a design discussion, so “done” means maintainers agree on the matching rules and the DNS/IP interface before any patch is written.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In 2015, https://github.com/ruby/openssl/pull/12 updated the certificate identity checking logic in ruby/openssl to follow RFC 6125, as a fix for https://bugs.ruby-lang.org/issues/9644.
We currently have 3 entry points for this check:
- During certificate chain validation, as part of
verify_callback, whenOpenSSL::SSL::SSLContext#verify_hostnameis enabled andOpenSSL::SSL::SSLSocket#hostname=(the SNI hostname) has been set OpenSSL::SSL::SSLSocket#post_connection_check(string), which can be called after#connectfinishesOpenSSL::SSL.verify_certificate_identity(cert, string)(undocumented, thoughgem-codesearchshows several usages)
Matching rules
Should we adopt the RFC 9525 rules? RFC 9525 was published in 2023-11, obsoleting RFC 6125:
https://www.rfc-editor.org/rfc/rfc9525
It removed rules that have long been deprecated:
- The subject Common Name (CN-ID) is no longer checked. Major browsers and libraries have already stopped checking it:
- Firefox 48 (2016): https://bugzilla.mozilla.org/show_bug.cgi?id=1245280
- Google Chrome 58 (2017): https://issues.chromium.org/issues/40078252
- Go 1.15 (2020) disabled it by default in crypto/tls: https://go.dev/doc/go1.15#commonname
- curl plans to remove CN fallback: https://github.com/curl/curl/pull/23986
- This mentions a breaking change in OpenSSL 4.1 that weakened certificate validation compared to OpenSSL 4.0. This also affects ruby/openssl: https://github.com/openssl/openssl/issues/33890
[ Checking DNS name constraints against subject CN started in OpenSSL 1.1.0, apparently: https://github.com/openssl/openssl/commit/5bd5dcd49605ca2aa7931599894302a3ac4b0b04 ]
- This mentions a breaking change in OpenSSL 4.1 that weakened certificate validation compared to OpenSSL 4.0. This also affects ruby/openssl: https://github.com/openssl/openssl/issues/33890
- Partial wildcards such as
abc*.example.comare no longer allowed. Browsers removed support in 2015:- Firefox 37 (2015): https://bugzilla.mozilla.org/show_bug.cgi?id=1107791
- Google Chrome 41 (2015): https://issues.chromium.org/issues/41143943
I think it's safe to remove support for partial wildcards.
Should we drop CN fallback, too?
Interface
The interface should allow users to specify whether the input is matched as a DNS host name or an IP address, since a plain string is ambiguous.
OpenSSL::SSL::SSLContext#verify_hostname is tied to SSLSocket#hostname=, which primarily is for SNI. This makes it unusable when connecting to an IP address, because IP addresses cannot be sent in SNI. This forces users to resort to an ugly workaround, as seen in net-http:
Implementation
We currently implement the identity check in Ruby because OpenSSL did not provide such a feature prior to OpenSSL 1.0.2.
ruby/openssl now requires OpenSSL 1.1.1 or later. Can we delegate this to X509_VERIFY_PARAM or X509_check_{host,ip}()?
- Ngôn ngữ chính
- C
- Star
- 276
- Fork
- 208
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ruby/openssl
-
SSLSocket#syswrite no longer raises IOError after IO#closeCó thể đã có người làm @sourya2704 đã nhận 4 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add OpenSSL::SSL::SSLContext#client_hello_cb= (binding for SSL_CTX_set_client_hello_cb())Có thể đã có người làm @kou đã nhận 45 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 53/100
ruby/openssl#1125 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Documenting how to use OpenSSL::SSL::SSLContext in PQC use casesCó thể đã có người làm @junaruga đã nhận 32 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
ruby/openssl#1118 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Expose XOFs like SHAKE128 and SHAKE256Có thể đã có người làm @rhenium đã nhận 142 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
ruby/openssl#1082 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
ruby/openssl#1075 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Polprzewodnikowy/N64FlashcartMenu#486 · 3 bình luận ·
-
[raygui] update to 5.0Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 2 ngày
-
crash
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
tree-sitter/tree-sitter-c#338 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100