🇰🇷 한글 설명
RFC 6528 기반 TCP ISN 구현 중 암호화 난수 생성 실패 시 예외 처리가 미흡하여 발생하는 취약점입니다. 난수 생성 실패 시 고유 키가 0으로 유지되어 TCP 초기 시퀀스 번호(ISN)가 예측 가능해지며, 이로 인해 TCP 연결 스푸핑 및 데이터 주입 공격이 가능해집니다.
💡 쉬운 설명
컴퓨터가 보안을 위해 사용하는 비밀번호 생성기가 고장 났을 때, 이를 확인하지 않고 계속 '0000'이라는 똑같은 값을 사용하는 문제입니다. 이 때문에 해커가 다음에 올 암호를 쉽게 맞출 수 있어 통신을 가로채거나 조작할 수 있습니다.
🇺🇸 원문 (English)
The RFC 6528 initial-sequence-number implementation in subsys/net/ip/tcp.c derived every TCP ISN from SHA-256(unique_key || four-tuple) plus a uptime-derived offset, where unique_key is a 128-bit secret filled once by sys_csrand_get(). The return value of that call was discarded and the once guard was latched to true even when the call failed. Because sys_csrand_get() leaves the destination buffer untouched on failure (it deliberately propagates the entropy-driver error rather than filling the buffer), a single failed call left unique_key as its all-zero BSS content for the remainder of the boot, with no retry, no log message and no fallback.
A failure of the cryptographic random source is required to reach the weak state — for example -ENODEV/-EIO from the entropy driver in subsys/random/random_entropy_device.c (the in-tree comment notes that the hardware RNG "might still be gathering entropy during early boot situations"), or psa_generate_random() failing in subsys/random/random_psa.c when PSA crypto is not initialised or is backed by a Bluetooth-HCI entropy device that is not yet up. The first TCP connection is what triggers key generation, so a remote peer that reaches a listening port immediately after boot, or that can provoke a reboot, has indirect influence over whether generation coincides with that window. tcp_init_isn() is called for every passive open in tcp_conn_new() and every active open in net_tcp_connect(), so the poisoned key governs all TCP connections for that boot.
With an all-zero key the ISN becomes a public function of the connection four-tuple plus a device-wide time offset. An off-path attacker can compute the hash term offline for any four-tuple and recover the shared time offset from a single observed ISN, after which the ISN the device will pick for other four-tuples is predictable. That defeats exactly the protection RFC 6528 provides: blind TCP connection spoofing against peers that trust the source address, and blind data injection into or reset of connections whose four-tuple can be guessed. Devices whose entropy source never errors were never in the weak state.
The fix moves key generation into a single guarded helper that latches only on success, logs the error otherwise, and makes tcp_init_isn() fall back to sys_rand32_get() — the behaviour already used when CONFIG_NET_TCP_ISN_RFC6528 is disabled — instead of hashing with a known-constant key.
📍 영향받는 시스템
RFC 6528 TCP ISN 구현을 사용하는 커널 기반 시스템 (sys_csrand_get() 실패 시)
⚔️ 공격 벡터
오프패스(Off-path) 공격자가 관찰된 ISN을 통해 시간 오프셋을 계산한 후, 예측 가능한 ISN을 이용해 TCP 연결 스푸핑 및 데이터 주입 수행
🛡️ 대응 방법
난수 생성 성공 시에만 키를 설정하도록 수정하고, 실패 시 기본 난수 생성 함수(sys_rand32_get)를 사용하도록 커널 패치 적용
🔧 검증 코드
커널 버전과 RFC 6528 설정 여부를 확인하고, 최신 보안 패치가 적용된 커널인지 제조사 보안 권고문을 통해 대조하십시오.
uname -a && grep -E 'CONFIG_NET_TCP_ISN_RFC6528' /boot/config-$(uname -r)