Summary
The actix-http WebSocket codec accepts a complete Text or Binary frame while a fragmented message is already in progress. RFC 6455 requires all subsequent data frames in that message to use the continuation opcode (0).
Reproduction
Run the Autobahn fuzzing client against the websockets/autobahn example converted to actix-ws.
- Autobahn case:
5.18
- Description: send a text message fragmented into two frames, with both frame opcodes set to Text
- Expected: reject the connection with protocol error
1002 (or drop the TCP connection) without delivering a message
- Actual: the server delivers
fragment2 as a message and closes with 1001
Likely cause
In actix-http/src/ws/codec.rs, the decoder checks continuation state for non-final frames, but the final-frame match returns Frame::Text or Frame::Binary without checking whether Flags::CONTINUATION is already set.
Suggested fix
Reject a final Text or Binary frame when a continuation is active, returning the existing continuation-state protocol error. Add a codec regression test and retain Autobahn case 5.18 as end-to-end coverage.
This is one of the remaining protocol failures from #1006. Legal fragmented messages already pass through actix-ws aggregation; this report concerns invalid frame sequencing.
Summary
The
actix-httpWebSocket codec accepts a complete Text or Binary frame while a fragmented message is already in progress. RFC 6455 requires all subsequent data frames in that message to use the continuation opcode (0).Reproduction
Run the Autobahn fuzzing client against the
websockets/autobahnexample converted toactix-ws.5.181002(or drop the TCP connection) without delivering a messagefragment2as a message and closes with1001Likely cause
In
actix-http/src/ws/codec.rs, the decoder checks continuation state for non-final frames, but the final-frame match returnsFrame::TextorFrame::Binarywithout checking whetherFlags::CONTINUATIONis already set.Suggested fix
Reject a final Text or Binary frame when a continuation is active, returning the existing continuation-state protocol error. Add a codec regression test and retain Autobahn case
5.18as end-to-end coverage.This is one of the remaining protocol failures from #1006. Legal fragmented messages already pass through
actix-wsaggregation; this report concerns invalid frame sequencing.