Actions
Bug #8543
open
UK
UK
decode/tcp: avoid unaligned access in TCP option parsing
Bug #8543:
decode/tcp: avoid unaligned access in TCP option parsing
Affected Versions:
Effort:
Difficulty:
Label:
C, Hardening, Protocol
Description
TCP option parsing in decode-tcp.c currently performs direct uint16_t pointer casts on byte-packed TCP option data.
Since TCP options are not guaranteed to be naturally aligned, this can cause unaligned memory access on strict-alignment architectures and also relies on undefined behavior in C.
Affected parsing paths include MSS and EXP/TFO option handling.
The proposed fix replaces direct casts with explicit byte-wise 16-bit extraction while preserving existing parsing behavior.
A pull request with the fix is already available:
https://github.com/OISF/suricata/pull/15207
PA Updated by Philippe Antoine 4 days ago
- Status changed from New to In Review
- Assignee set to Urval Kheni
- Target version changed from TBD to 9.0.0-beta1
Actions