🇰🇷 한글 설명
Linux 커널의 rtl8723bs 드라이버에서 WPS 속성을 처리할 때 발생하는 스택 버퍼 오버플로우 및 OOB Read 취약점입니다. 공격자가 조작된 WPS IE를 포함한 무선 관리 프레임을 전송하면, 검증되지 않은 속성 길이를 사용하여 스택 메모리를 덮어쓸 수 있습니다.
💡 쉬운 설명
무선 랜 카드가 외부에서 보내온 잘못된 정보를 읽을 때, 데이터의 길이를 제대로 확인하지 않아 컴퓨터의 중요한 메모리 영역을 망가뜨릴 수 있는 문제입니다. 이를 통해 해커가 시스템을 제어하거나 정보를 훔칠 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
staging: rtl8723bs: fix OOB read / stack overflow in rtw_get_wps_attr()
rtw_get_wps_attr() walks WPS attributes inside a WPS IE taken from
a wireless management frame. For each candidate attribute it only
checks that the fixed 4-byte attribute header (2-byte ID + 2-byte
length) fits inside the IE:
if (attr_ptr + 4 > wps_ie + wps_ielen)
break;
u16 attr_id = get_unaligned_be16(attr_ptr);
u16 attr_data_len = get_unaligned_be16(attr_ptr + 2);
u16 attr_len = attr_data_len + 4;
attr_data_len (and therefore attr_len) is read directly from the
wire and is never checked against the remaining bytes in the IE
before being used as the size of:
memcpy(buf_attr, attr_ptr, attr_len);
Since attr_len is fully attacker controlled (0 to 65535+4), this is
both a heap OOB read of wps_ie, and, more seriously, a stack buffer
overflow at several call sites where buf_attr is a single-byte
stack variable, e.g. rtw_get_wps_attr_content()'s callers passing
WPS_ATTR_SELECTED_REGISTRAR into a stack "u8 sr"/"u8
selected_registrar" (drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c,
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c). A crafted WPS IE in a
beacon or probe response processed during scanning can therefore
smash the stack of the parsing thread.
rtw_get_wps_attr_content() itself has no independent length check
and simply trusts the attr_len it gets back from rtw_get_wps_attr(),
so fixing the bound here also fixes that caller.
The "attr_ptr + 4 > wps_ie + wps_ielen" header check above was added
by commit 1463ca3ec6601 ("staging: rtl8723bs: fix OOB reads in
rtw_get_sec_ie(), rtw_get_wapi_ie(), and rtw_get_wps_attr()"), which
bounded the fixed header but never extended the check to cover the
variable-length attribute data that follows it. Add that missing
check before attr_len is used as a memcpy() length or accepted as a
match.
📍 영향받는 시스템
Linux kernel (staging: rtl8723bs driver)
⚔️ 공격 벡터
스캐닝 과정에서 조작된 WPS IE가 포함된 비콘(Beacon) 또는 프로브 응답(Probe Response) 프레임을 전송
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 rtl8723bs 드라이버의 길이 검증 로직을 수정해야 합니다.
🔧 검증 코드
현재 사용 중인 커널 버전과 rtl8723bs 모듈 정보를 확인하여 패치 적용 여부를 판단합니다.
uname -r && modinfo rtl8723bs 2>/dev/null | grep -i version