🇰🇷 한글 설명
Linux 커널의 netfilter ebtables 구성 요소에서 사용자 제공 테이블 이름이 NUL 문자로 종료되지 않아 발생하는 스택 범위 초과 읽기 취약점입니다. 이로 인해 vsnprintf 함수가 메모리 상의 제로 바이트를 찾을 때까지 스택 객체를 넘어 데이터를 읽게 되어 시스템 불안정성이나 정보 유출을 초래할 수 있습니다.
💡 쉬운 설명
컴퓨터가 이름을 읽을 때 이름이 어디서 끝나는지 알려주는 표시가 없어, 이름 뒤에 있는 다른 중요한 정보까지 읽어버리는 문제입니다. 이로 인해 시스템이 멈추거나 보안 정보가 노출될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
netfilter: ebtables: terminate table name before find_table_lock()
update_counters() and compat_update_counters() forward a user-supplied
32-byte table name to find_table_lock() without NUL-terminating it. On a
lookup miss, find_inlist_lock() calls try_then_request_module(..., "%s%s",
"ebtable_", name), and vsnprintf() reads past the name field and the
stack object until it hits a zero byte.
BUG: KASAN: stack-out-of-bounds in string (lib/vsprintf.c:648 lib/vsprintf.c:730)
Read of size 1 at addr ffff8880119dfb20 by task exploit/147
Call Trace:
...
string (lib/vsprintf.c:648 lib/vsprintf.c:730)
vsnprintf (lib/vsprintf.c:2945)
__request_module (kernel/module/kmod.c:150)
do_update_counters.isra.0 (net/bridge/netfilter/ebtables.c:371 net/bridge/netfilter/ebtables.c:380)
update_counters (net/bridge/netfilter/ebtables.c:1440)
do_ebt_set_ctl (net/bridge/netfilter/ebtables.c:2573)
nf_setsockopt (net/netfilter/nf_sockopt.c:101)
ip_setsockopt (net/ipv4/ip_sockglue.c:1424)
raw_setsockopt (net/ipv4/raw.c:847)
__sys_setsockopt (net/socket.c:2393)
...
compat_do_replace() shares the same unterminated name via
compat_copy_ebt_replace_from_user(); terminate it there too so all
find_table_lock() callers behave alike. The other callers already
terminate the name after the copy.
📍 영향받는 시스템
NUL 종료 처리가 누락된 특정 버전의 Linux Kernel (netfilter/ebtables 포함)
⚔️ 공격 벡터
사용자가 조작된 32바이트 테이블 이름을 포함한 setsockopt 시스템 호출을 전송
🛡️ 대응 방법
ebtables 테이블 이름 복사 시 NUL 문자로 종료하도록 커널 패치 적용 및 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 최신 보안 패치 버전인지 확인