🇰🇷 한글 설명
wolfSSL의 세션 캐시 관리 결함으로 인해 TLS 1.2 이하 버전에서 세션 ID 충돌을 이용한 서버 위장 공격이 가능합니다. 공격자가 동일한 세션 ID를 가진 다른 서버의 정보를 캐시에 주입하면, 클라이언트는 인증 과정 없이 공격자의 서버를 원래 서버로 오인하여 연결을 수립하게 됩니다. 이 취약점은 프로세스 전역 캐시를 공유하므로 서로 다른 컨텍스트 간에도 영향을 미칠 수 있습니다.
💡 쉬운 설명
해커가 가짜 정보를 세션 저장소에 몰래 끼워 넣어, 사용자가 안전한 사이트에 접속하는 것처럼 속여 공격자의 서버로 연결되게 만드는 보안 결함입니다. 인증 과정을 건너뛰게 만들기 때문에 사용자는 자신이 공격자와 연결되었음을 알기 어렵습니다.
🇺🇸 원문 (English)
Without NO_SESSION_CACHE_REF, wolfSSL_get_session() does not return a session object but a ClientSession reference of the form {row, index, hash(sessionID)} into the process-global SessionCache, and ClientSessionToSession() validates it against that hash alone. Because the TLS 1.2 session ID is chosen by the server and sent in clear, AddSessionToCache() matches any other server's session on the same ID and overwrites the client-side entry with that server's master secret, cipher suite and version, while the handle continues to resolve; nothing on the write path compares the peer, the application's server ID or the WOLFSSL_CTX. Resuming through the handle then produces an abbreviated handshake in which no Certificate message is sent, so neither chain verification nor wolfSSL_check_domain_name() runs, and the attacker is accepted as the original server for the whole of that connection. Affected builds are those leaving NO_SESSION_CACHE_REF, NO_SESSION_CACHE, NO_CLIENT_CACHE and TITAN_SESSION_CACHE all undefined, which includes a plain ./configure, --enable-opensslextra and --enable-opensslall; fifteen integration options define NO_SESSION_CACHE_REF and are therefore not affected, among them --enable-all, --enable-distro, --enable-curl, --enable-nginx, --enable-haproxy, --enable-stunnel, --enable-wpas and the rest of the OPENSSL_COMPATIBLE_DEFAULTS family, and --enable-leanpsk, --enable-leantls, --enable-lowresource and --enable-tinytls13 disable the cache outright. The application must use the legacy reference flow, wolfSSL_get_session() or SSL_get_session() followed by wolfSSL_set_session(); wolfSSL_get1_session() returns the session object itself and is not affected, nor are wolfSSL_SetServerID() lookups. Only TLS 1.2 and below and DTLS 1.2 and below are reachable, since TLS 1.3 and ticket resumption with an empty ServerHello session ID both use a client-chosen cache key. The poisoned entry lives in the process-global cache, so it crosses WOLFSSL_CTX boundaries and persists until the entry is evicted or the session times out, 500 seconds by default. Releases v5.3.0 through v5.9.2 are affected; the fix adds a per-write generation counter to the cache and raises WOLFSSL_CACHE_VERSION from 2 to 3, so a cache persisted by an older build is rejected by a fixed one.
📍 영향받는 시스템
wolfSSL v5.3.0 ~ v5.9.2 (NO_SESSION_CACHE_REF 등이 정의되지 않은 빌드)
⚔️ 공격 벡터
TLS 1.2 이하에서 서버가 전송하는 세션 ID를 가로채거나 동일한 ID를 사용하여 세션 캐시를 오염시킨 후 세션 재개(Resumption) 유도
🛡️ 대응 방법
wolfSSL을 최신 패치 버전(WOLFSSL_CACHE_VERSION 3 적용 버전)으로 업데이트하거나, NO_SESSION_CACHE_REF 옵션을 사용하여 빌드함
🔧 검증 코드
출력된 버전이 v5.3.0에서 v5.9.2 사이의 범위에 해당하면 취약한 버전일 가능성이 높습니다.
wolfssl_version_check_command_placeholder 2>/dev/null | grep -E 'v5\.(3|4|5|6|7|8|9)\.[0-9]+'