mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-07-02 10:37:03 -04:00
Merge branch 'fix-448-invalid-framing' into 'main'
reject connections with invalid framing See merge request veilid/veilid!407
This commit is contained in:
commit
efaea17f38
1 changed files with 8 additions and 0 deletions
|
@ -151,6 +151,14 @@ impl RawTcpProtocolHandler {
|
|||
return Ok(None);
|
||||
}
|
||||
|
||||
// Ensure this has a chance of being proper framed, otherwise drop the connection
|
||||
// This will keep upgraded WS->WSS TLS negotiations from getting punished if the
|
||||
// WSS accept handler isn't enabled
|
||||
if peekbuf[0] != b'V' || peekbuf[1] != b'L' {
|
||||
// Not framed TCP, drop it
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let peer_addr = PeerAddress::new(
|
||||
SocketAddress::from_socket_addr(socket_addr),
|
||||
ProtocolType::TCP,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue