Zephyr
Zephyr HTTP сервері HTTP/2 арқылы статикалық файлдарды ұсынған кезде осалдыққа ұшырайды. Кіру мүмкіндігі жоқ қашықтағы шабуылдаушы веб-түбірдегі файлға арнайы жасалған GET сұрауын жіберіп, сервер жадын бүлдіруі мүмкін, бұл тұтастық пен қолжетімділікке жоғары әсер етуі ықтимал.
Түйіндемені дереккөздер негізінде ЖИ жасаған және ол автоматты түрде аударылған.
HTTP/2 сервері статикалық файлдық жүйе ресурсын ұсынатын Zephyr 4.0.0-ден 4.3.2-ге дейінгі және 4.4.0-ден 4.5.0-ге дейінгі нұсқаларына әсер етеді. Zephyr 4.3.2 және 4.5.0 нұсқаларында түзетілген.
Сервердің адрестік кеңістігіндегі қашықтан жадты бүлдіру, ең азында құрылғының істен шығуы немесе ілуі, сондай-ақ басқару деректерін қайта жазу арқылы код орындауға әкелуі мүмкін.
Түзетілген нұсқалар: 4.3.24.5.0
| zephyr | бастап 4.0.0 → түзетілді 4.3.2 бастап 4.4.0 → түзетілді 4.5.0 |
Zephyr 4.0.0-ден 4.3.2-ге дейінгі немесе 4.4.x-тен 4.5.0-ге дейінгі нұсқаларды пайдаланып, HTTP/2 сервері арқылы статикалық файлдық жүйе ресурсымен статикалық файлдарды ұсынатын командалар.
HTTP/2 серверінің статикалық файлдық жүйе өңдеушісіндегі бүлінген қабылдау буферінің ұзындығы буфер соңынан тыс жазуға мүмкіндік береді. Zephyr бір адрестік кеңістікте жұмыс істейді, сондықтан бұл жадты бүлдіреді және ең азында құрылғыны істен шығаруы немесе ілуі мүмкін.
Осалдық Zephyr 4.0.0-ден 4.3.2-ге дейінгі және 4.4.0-ден 4.5.0-ге дейінгі нұсқаларына әсер етеді, мұнда HTTP/2 сервер қолдауы қосылған (CONFIG_HTTP_SERVER_VERSION_2, әдепкі бойынша қосулы) және қолданба CONFIG_FILE_SYSTEM=y арқылы статикалық файлдық жүйе ресурсын тіркейді. Тексеру үшін бастапқы код ағашындағы Zephyr нұсқасын және құрастыру конфигурациясындағы осы екі параметрді қараңыз.
4.3 желісі үшін Zephyr 4.3.2 нұсқасына немесе 4.4 желісі үшін 4.5.0 нұсқасына жаңартыңыз.
Түпнұсқа тақырып: Zephyr remote code execution in HTTP server static file handler
The HTTP/2 front-end of the Zephyr HTTP server aliased connection receive state as a scratch output. In subsys/net/lib/http/http_server_http2.c, handle_http2_static_fs_resource() passed &client->data_len as the file_size out-parameter of http_server_find_file(). client->data_len is the count of unprocessed bytes remaining in the fixed-size per-connection receive buffer client->buffer[CONFIG_HTTP_SERVER_CLIENT_BUFFER_SIZE] (256 bytes by default), an invariant every frame handler and the socket receive path rely on. Serving any static file therefore replaced that bounded value with the file's on-disk size, and nothing resets it afterwards. The defect is reached by an unauthenticated HTTP/2 GET for any file under the web root, in applications that register a static-filesystem resource (HTTP_RESOURCE_TYPE_STATIC_FS) with CONFIG_FILE_SYSTEM=y; CONFIG_HTTP_SERVER_VERSION_2 is enabled by default and no TLS or credentials are required on this path. Once client->data_len exceeds the buffer size, the frame dispatch loop in subsys/net/lib/http/http_server_core.c keeps parsing past the end of the received data, and the peer controls the bytes at client->cursor, so it can choose which fabricated frame the state machine consumes next by appending bytes after its request. The inflated length defeats the only guards on the buffer. parse_http_frame_header() and the per-frame handlers read and skip up to a 24-bit frame length beyond the buffer (out-of-bounds read); the compaction memmove(client->buffer, client->cursor, client->data_len) at the end of request handling copies the file-size number of bytes into the 256-byte buffer, overflowing the rest of struct http_client_ctx — including the current_detail/current_stream pointers, the parser_settings function-pointer table and the inactivity_timer work handler — and the adjacent client contexts in static memory; and the subsequent zsock_recv(client->fd, client->buffer + client->data_len, sizeof(client->buffer) - client->data_len, 0) underflows its size argument, writing attacker-supplied data of attacker-chosen length out of bounds. The impact is remote memory corruption in the server's single address space: at minimum a crash or hang of the device, and plausibly control-data overwrite leading to code execution. The HTTP/1 and HTTP/3 static-filesystem handlers already used a local variable and are unaffected; the fix makes the HTTP/2 handler use a local size_t file_size as well.