Skip to content

bound session_id_len in mg_tls_server_recv_hello#3582

Closed
alhudz wants to merge 1 commit into
cesanta:masterfrom
alhudz:bound-clienthello-session-id
Closed

bound session_id_len in mg_tls_server_recv_hello#3582
alhudz wants to merge 1 commit into
cesanta:masterfrom
alhudz:bound-clienthello-session-id

Conversation

@alhudz
Copy link
Copy Markdown

@alhudz alhudz commented Jun 2, 2026

mg_tls_server_recv_hello() reads session_id_len from the ClientHello at offset 43 and uses it to locate cipher_suites_len at rio->buf[44 + session_id_len], with only a rio->len >= 50 check. A client sending session_id_len up to 255 in a short record reads past the buffer (ASAN flags a heap-buffer-overflow ~250 bytes out). Bound it against rio->len before use, the same way the later length fields are checked.

@cpq
Copy link
Copy Markdown
Member

cpq commented Jun 2, 2026

@alhudz could you report this to the https://github.com/cesanta/mongoose/security/advisories please ?

@alhudz
Copy link
Copy Markdown
Author

alhudz commented Jun 2, 2026

Sure, will do.

@scaprile
Copy link
Copy Markdown
Collaborator

scaprile commented Jun 2, 2026

@cpq YAD (Yet another duplicate).

@scaprile scaprile closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants