When nftables matches a ClientHello packet and sends it to nfqueue, Linux conntrack may cause all subsequent segments of the same TCP connection to be enqueued as well. This was confirmed by observing a 114-byte segment (clearly not a ClientHello) entering send_split immediately after a 1448-byte segment from the same connection.
Impact
In practice, these subsequent segments going through handle_packet is harmless. They belong to the same connection as the ClientHello and will be split anyway. However, the current implementation treats every packet entering send_split as a full ClientHello, which is incorrect. Fragmented continuation segments are being processed as if they were independent ClientHellos, which diverges from the intended behavior.
Possible mitigations
- TCP reassembly: Reassemble segments before processing. Correct, but expensive.
- Inspect nfqueue metadata: Use conntrack state or packet metadata exposed by nfqueue to distinguish the first segment from continuations, and route them separately without ClientHello processing.
Either approach involves non-trivial refactoring cost.
Platform note
WinDivert behavior on Windows needs to be investigated. It may or may not exhibit the same characteristic.
When nftables matches a ClientHello packet and sends it to nfqueue, Linux conntrack may cause all subsequent segments of the same TCP connection to be enqueued as well. This was confirmed by observing a 114-byte segment (clearly not a ClientHello) entering send_split immediately after a 1448-byte segment from the same connection.
Impact
In practice, these subsequent segments going through
handle_packetis harmless. They belong to the same connection as the ClientHello and will be split anyway. However, the current implementation treats every packet enteringsend_splitas a full ClientHello, which is incorrect. Fragmented continuation segments are being processed as if they were independent ClientHellos, which diverges from the intended behavior.Possible mitigations
Either approach involves non-trivial refactoring cost.
Platform note
WinDivert behavior on Windows needs to be investigated. It may or may not exhibit the same characteristic.