🇰🇷 한글 설명
Bouncy Castle for Java FIPS(BC-FJA) bc-fips 2.1.3 이전 버전에서 Intel 플랫폼의 네이티브 엔트로피 소스 재시도 루프에 상한이 없어, RDSEED/RDRAND 지속 실패 시 JNI 호출 스레드가 무한 대기할 수 있었습니다. 해당 루프는 상한(RDSEED 200회, RDRAND 20회)과 예외 처리가 추가되어 수정되었습니다.
💡 쉬운 설명
암호화에 필요한 난수를 만드는 하드웨어가 계속 실패하면 프로그램이 멈춰버릴 수 있었습니다. 이제는 일정 횟수 시도 후 오류를 내고 멈추지 않도록 고쳐졌습니다.
🇺🇸 원문 (English)
In Bouncy Castle for Java FIPS (BC-FJA) before bc-fips 2.1.3, the native entropy source used on Intel platforms retried the CPU entropy instructions without any bound. RDSEED and RDRAND report failure through their carry flag, and the JNI seeding routine spun re-issuing the instruction for as long as that flag stayed clear, so a persistent failure of the on-chip entropy source - whether from a hardware fault, from the underlying DRBG being exhausted by contention across many cores, or from a hypervisor that does not provide the instruction - left the calling thread looping indefinitely inside the JNI call, where it could be neither interrupted nor timed out. Any operation drawing from the native entropy source could therefore hang, denying service to the application. The retry loops are now bounded (200 attempts for RDSEED and 20 for RDRAND, twice the baselines given in Intel's Digital Random Number Generator software implementation guide), pausing between attempts and, on exhaustion, clearing any partially written buffer and throwing rather than continuing to spin. The clear is performed by an un-elidable memzero, which uses a volatile pointer and an assembly memory barrier so that a compiler cannot optimise the erase away as a dead store. Bouncy Castle for Java (bcprov) is not affected, as it has no native entropy source; the 1.0.X and 2.0.X FIPS series are not affected.
📍 영향받는 시스템
Bouncy Castle for Java FIPS(bc-fips) 2.1.3 미만, Intel 플랫폼 (bcprov 및 1.0.X/2.0.X FIPS 시리즈는 영향 없음)
⚔️ 공격 벡터
하드웨어 결함, 다수 코어 경합으로 인한 DRBG 고갈, 또는 명령어를 지원하지 않는 하이퍼바이저 환경에서 발생하는 엔트로피 실패로 인한 서비스 거부(DoS)
🛡️ 대응 방법
bc-fips 2.1.3 이상으로 업그레이드
🔧 검증 코드
출력된 bc-fips 버전이 2.1.3 미만이면 취약하므로 2.1.3 이상으로 업그레이드가 필요하며, 버전 정보가 없으면 수동 확인이 필요합니다.
find / -name 'bc-fips-*.jar' 2>/dev/null | xargs -I{} sh -c 'echo {}; unzip -p {} META-INF/MANIFEST.MF 2>/dev/null | grep -i version'