Improper Enforcement of Message Integrity During Transmission in a Communication Channel in scapy - #VU159470
Published: November 5, 2026
Vulnerability details
The vulnerability allows a remote attacker who can inject records into an authenticated TCP stream to overwrite server-side files through Scapy's SMB server without possessing the session signing or encryption key, bypassing an advertised requirement for session encryption.
The vulnerability exists due to missing inbound enforcement of the session encryption policy. Successful non-guest SMB3 session setup advertises ENCRYPT_DATA, sets EncryptData, and disables signing, but EncryptData is consulted only when preparing outbound messages. SMBSession.in_pkt() decrypts SMB transform records but accepts ordinary SMB2 headers without checking whether encryption is required; because signing is disabled, injected plaintext requests also receive no signature check. A remote attacker can inject an unsigned, unencrypted SMB2 WRITE into an established authenticated connection to a server configured with REQUIRE_ENCRYPTION and a writable share, after the client has negotiated SMB3 encryption and connected to a tree, causing the file handler to write attacker-controlled bytes.
Scapy's SMB_Server attaches an SMBStreamSocket to each accepted DirectTCP connection. SMBStreamSocket.recv() forwards accepted requests to the server's handlers, and the WRITE handler opens the selected path and writes the supplied data. The demonstrated plaintext WRITE changes a server-side file despite the session requiring encryption. This is an inbound policy-enforcement failure rather than an inability to encrypt replies: encrypted requests are decrypted normally, set NextForceEncrypt for their responses, and use the existing outbound encryption path.