🇰🇷 한글 설명
Linux 커널의 nfc: st21nfca 드라이버에서 수신된 ATR_REQ 프레임의 길이를 검증하지 않아 발생하는 취약점입니다. 공격자가 실제 데이터보다 큰 길이를 선언한 프레임을 보내면, 커널 메모리의 경계를 넘어 데이터를 읽어내는 Out-of-bounds read가 발생합니다. 이를 통해 커널 메모리 정보가 유출되거나 시스템 서비스 거부(DoS)가 발생할 수 있습니다.
💡 쉬운 설명
NFC 통신 중에 가짜 정보를 담은 짧은 신호를 보내면, 컴퓨터가 실제 데이터보다 더 많은 양을 읽으려다 메모리 내부의 비밀 정보를 흘리거나 멈춰버릴 수 있는 문제입니다. 근처에 있는 공격자가 특수한 NFC 신호를 보내 이를 악용할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
nfc: st21nfca: validate ATR_REQ length against the received frame
st21nfca_tm_recv_atr_req() checks that the received ATR_REQ frame is at
least ST21NFCA_ATR_REQ_MIN_SIZE and that the self-declared atr_req->length
is at least sizeof(struct st21nfca_atr_req), but never checks that
atr_req->length does not exceed the actual received length (skb->len).
st21nfca_tm_send_atr_res() then trusts the declared length:
gb_len = atr_req->length - sizeof(struct st21nfca_atr_req);
...
memcpy(atr_res->gbi, atr_req->gbi, gb_len);
so an RF peer that sends a short frame but sets atr_req->length larger
than the frame makes gb_len exceed the general bytes actually present,
and the memcpy reads out of bounds past the received skb. Those bytes are
placed in the ATR_RES and sent back to the peer (kernel-memory disclosure
to a proximity attacker); a larger declared length is an out-of-bounds
read (DoS).
Reject frames whose declared length exceeds the received length. The
adjacent nfc_tm_activated() path in the same function already derives its
general-bytes length from skb->len rather than the declared field.
Found by 0sec (https://0sec.ai) using automated source analysis; the
missing bound is evident from source. Compile-tested.
📍 영향받는 시스템
Linux kernel (nfc: st21nfca driver component)
⚔️ 공격 벡터
근접한 공격자가 실제 수신된 프레임 길이보다 큰 길이를 선언한 조작된 ATR_REQ 프레임을 NFC를 통해 전송
🛡️ 대응 방법
수신된 프레임의 선언된 길이가 실제 데이터 길이(skb->len)를 초과하지 않도록 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 최신 보안 패치 버전인지 확인합니다.