Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
d-os-descriptor — CVE-2022-25258 - USB 가젯의 OS 디스크립터 핸들러를 대상으로 하는 데모 익스플로잇 | Kitploit
도구/GitHubGitHub/szymonh/d-os-descriptor
Embedded Systems SecurityVulnerability AnalysisExploitationFuzzingHardware SecurityBinary Exploitation
GitHubszymonh/d-os-descriptor

d-os-descriptor

CVE-2022-25258 - USB 가젯의 OS 디스크립터 핸들러를 대상으로 하는 데모 익스플로잇

저장소 보기
14년 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

d-os-descriptor

요약

USB Gadget 서브시스템은 composite_setup 함수(composite.c)의 OS 디스크립터 처리 섹션에 보안 문제를 포함합니다. 적절하게 조작된 제어 전송 요청 메시지를 처리하면 널 포인터 역참조 또는 메모리 손상으로 인해 장치가 충돌합니다.

설명

interface 수신자에 대한 composite_setup의 OS 디스크립터 처리 섹션은 다음과 같이 구현됩니다.

root@kitploit:~
case USB_RECIP_INTERFACE:
    if (w_index != 0x5 || (w_value >> 8))
        break;
    interface = w_value & 0xFF;
    buf[6] = w_index;
    count = count_ext_prop(os_desc_cfg,
        interface);
    put_unaligned_le16(count, buf + 8);
    count = len_ext_prop(os_desc_cfg,
        interface);
    put_unaligned_le32(count, buf);
    value = w_length;
    if (w_length > 0x0A) {
        value = fill_ext_prop(os_desc_cfg,
                        interface, buf);
        if (value >= 0)
            value = min_t(u16, w_length, value);
}
break;

interface 변수는 w_value에서 파생되며 이후 count_ext_prop, len_ext_prop 및 fill_ext_prop 함수에서 usb_configuration->interface 배열을 인덱싱하는 데 사용됩니다. c->interface 배열의 크기는 MAX_CONFIG_INTERFACES(16) 요소이며 interface 변수는 composite_setup의 OS 디스크립터 처리 섹션이나 호출된 함수에서 검증되지 않으므로 공격자가 c->interface 배열을 실제 경계 너머로 인덱싱할 수 있습니다. interface 변수의 값이 MAX_CONFIG_INTERFACES보다 크거나 같으면 엔드포인트가 중단(stall)되어야 합니다.

특정 경우, 실제 메모리 내용에 따라 c->interface 배열을 벗어난 인덱싱은 wLength가 0x0A보다 클 때 fill_ext_prop를 통해 req->buf의 버퍼 오버플로를 유발할 수 있습니다. ext_prop->name_len, ext_prop->data_len, 14 및 10의 합이 int를 오버플로하면 count + n >= USB_COMP_EP0_OS_DESC_BUFSIZ 조건이 충족되지 않아 usb_ext_prop_put_binary의 memcpy를 통한 오버플로가 허용될 수 있습니다. 그러나 이러한 상황의 확률은 매우 낮아 보입니다.

또한 count_ext_prop, len_ext_prop 및 fill_ext_prop 함수는 c->interface 배열에서 검색된 *usb_function이 실제로 유효한지 검증하지 않아 널 포인터 역참조가 발생합니다. 검색된 usb_function 포인터가 널이면 엔드포인트가 중단되어야 합니다.

root@kitploit:~
static int count_ext_prop(struct usb_configuration *c, int interface)
{
	struct usb_function *f;
	int j;

	f = c->interface[interface];
	for (j = 0; j < f->os_desc_n; ++j) {
		struct usb_os_desc *d;

	    if (interface != f->os_desc_table[j].if_id)
	    	continue;
	    d = f->os_desc_table[j].os_desc;
	    if (d && d->ext_compat_id)
	    	return d->ext_prop_count;
    }
return 0;
}

영향

OS 디스크립터를 지원하는 usb gadget을 노출하는 Linux(및 Android) 장치는 악의적인 호스트가 단일 제어 전송 메시지를 통해 임의로 충돌시킬 수 있습니다.

CVE

CVE-2022-25258

패치

설명된 문제를 해결하는 패치가 승인되었으며 지원되는 커널 버전에서 사용할 수 있습니다. 자세한 내용은 아래 링크를 참조하십시오.

USB: gadget: validate interface OS descriptor requests

도구 다운로드