Description: A malicious server can trigger a heap buffer over-read in a client application when responding to a specific SMB request, potentially disclosing sensitive information. This occurs because the client's parsing of the response does not adequately validate the data offset, leading to an out-of-bounds read.
How to Test:
- Set up a malicious SMB server using a provided script (e.g.,
smbexploitserver.py) on a specific port (e.g., 4455). - Configure a client application (e.g.,
curl) to connect to the malicious server using a specified URL (e.g.,smb://<TARGET_URL>:4455/share/file.txt). Use dummy credentials (e.g.,-u anyuser:anypass). - Initiate a file transfer using the client application.
- Verify the size of the received data. The expected size should be larger than the amount of legitimate data sent by the server.
- Examine the contents of the received data to identify leaked heap memory. A payload such as
AAAAAAAAAAAAAAAAcan be sent from the server to more easily identify the heap leak.
Impact: Potential disclosure of sensitive information, including authentication credentials, session tokens, and memory layout, which could be used for further exploitation.
Remediation: Implement robust input validation within the SMB parsing logic to ensure data offsets are within the boundaries of the expected response structure. Specifically, verify the offset against the message layout and byte count.