🇰🇷 한글 설명
uhttpd 소형 HTTP 서버의 ubus.c에 있는 uh_ubus_data_send() 함수가 POST /ubus JSON 본문이 여러 TCP 세그먼트로 나뉘어 도착할 때 HTTP 요청 경계를 잘못 처리하는 문제입니다. 이로 인해 읽지 않은 본문 뒷부분에 포함된 HTTP 요청이 같은 keep-alive 연결에서 새 요청으로 처리될 수 있습니다. 패치 커밋 7b1bec45826bd78c8afc993435bdc0f1df2fe399 및 b2285de129b9adc8b12f84f9a27c16c21f2b57a5로 수정되었습니다.
💡 쉬운 설명
웹 서버가 요청 본문을 끝까지 읽지 않아서, 그 안에 숨겨진 다른 요청이 별도 요청으로 처리될 수 있습니다. 이는 요청 경계가 어긋나는 문제로 보안 공격에 악용될 가능성이 있습니다.
🇺🇸 원문 (English)
uhttpd is a small HTTP server. In unpatched repository snapshots, `uh_ubus_data_send()` in `ubus.c` can desynchronize HTTP request boundaries when a `POST /ubus` JSON body arrives in multiple TCP segments. An initial segment completing a JSON object sets `du->jsobj`; a later segment takes the existing-object parse-error path and returns zero bytes consumed. The caller neither drains the remaining declared `Content-Length` nor sets `connection_close`. An HTTP request embedded in the unread body suffix is consequently processed as a new request on the same keep-alive connection. The reported reproducer returned a JSON-RPC parse error followed by a second HTTP response. This application-layer body-handler flaw is distinct from Transfer-Encoding header case handling and chunk-length state reset, and affects deployments enabling ubus, including the default OpenWrt configuration and potential proxy/CDN deployments. Repository patches 7b1bec45826bd78c8afc993435bdc0f1df2fe399 and b2285de129b9adc8b12f84f9a27c16c21f2b57a5 address this issue.
📍 영향받는 시스템
ubus 기능을 활성화한 uhttpd 패치 이전 저장소 스냅샷 (기본 OpenWrt 구성 포함)
⚔️ 공격 벡터
POST /ubus 요청의 JSON 본문을 여러 TCP 세그먼트로 분할 전송하여 본문 뒤에 숨긴 HTTP 요청을 같은 keep-alive 연결에서 처리하게 함 (요청 스머글링 유형)
🛡️ 대응 방법
패치 커밋 7b1bec45826bd78c8afc993435bdc0f1df2fe399 및 b2285de129b9adc8b12f84f9a27c16c21f2b57a5가 포함된 uhttpd 버전으로 업데이트하거나, ubus 기능을 비활성화합니다.
🔧 검증 코드
uhttpd 설치 버전이 패치 이전 버전인지 확인하고, uci 출력에 ubus_prefix 설정이 있으면 ubus 기능이 활성화된 상태이므로 취약할 수 있으니 패치 적용 여부를 확인해야 합니다.
opkg list-installed uhttpd 2>/dev/null; uci show uhttpd 2>/dev/null | grep -i ubus