Input validation error in scapy - #VU159462
Published: November 5, 2026
Vulnerability details
The vulnerability allows a remote LDAP server to terminate a Scapy client's connection after SASL signing or encryption has been negotiated, causing a denial of service on the affected socket. The stream reader stops, the socket is closed, and calls using that socket return no packet rather than waiting for an incomplete record.
The vulnerability exists due to improper validation of incomplete stream data in LDAP_SASL_Buffer.tcp_reassemble. Its plain-LDAP error heuristic performs BER decoding before interpreting the SASL record length, allowing a decoding exception to escape instead of returning None to signal that more data is needed. A remote attacker can send the four bytes 30 84 00 00 while acting as the LDAP peer after SASL signing or encryption is negotiated. The leading byte 30 selects the heuristic, and 84 indicates that four BER length bytes follow, although only two are buffered, triggering the exception.
LDAP_Client.bind switches the existing network socket to the LDAP_SASL_Buffer decoder for length-prefixed protected records, placing the bytes consumed by the stream callback under the remote peer's control. StreamSocket.recv invokes the reassembler before DefaultSession.recv reaches its guarded call, so the exception escapes that session-level handling and causes the socket to close. The failure was reproduced with the default configuration.