Heap out-of-bounds reads in libsmb2 QUERY INFO filesystem decoders
fixed
Details
libsmb2 sahlberg master before dd0bbdee2; fixed 2026-07-28 (PR #471) CWE-125 medium fixed Timeline
13 Jul 2026 27 Jul 2026 28 Jul 2026 References
Notes
Two heap out-of-bounds reads in the QUERY INFO (FILESYSTEM) reply decoders
(lib/smb2-data-filesystem-info.c), reached from
smb2_process_query_info_variable() with vec pointing straight into the
received PDU. Each reads an attacker-controlled 32-bit length from the reply and
feeds length/2 UTF-16 units to smb2_utf16_to_utf8() (unicode.c), which walks
that many units off the buffer with no bound against vec->len. smb2_get_uint32
is bounds-checked but its return value is ignored. Attacker = a malicious SMB
server. The sibling decoders (fs_size_info, fs_device_info) already gate on
vec->len — these two are the outliers.
smb2_decode_file_fs_volume_info— sink at:71, novec->lencheck at all. Fix: requirevec->len >= 18and rejectvolume_label_length > vec->len - 18.smb2_decode_file_fs_attribute_info— sink at:190, guardsvec->len < 20only. Fix: rejectname_len > vec->len - 12.
Same family as the disclosed NTLM CHALLENGE over-read; intended to bundle to the maintainer with the other libsmb2 findings. ASan-confirmed with PoCs and a verified fix; disclosure pending.