#1151580 libsmb2: please consider backporting three upstream memory-safety fixes

Package:
libsmb2
Source:
libsmb2
Submitter:
Yuanfu Xie
Date:
2026-11-13 18:37:02 UTC
Severity:
normal
Tags:
#1151580#5
Date:
2026-10-21 19:39:06 UTC
From:
To:
Hello,

I have been testing the libsmb2 client in 6.2 against servers that
return malformed SMB2 replies. Four client-side memory-safety bugs are
reachable that way; all four are already fixed upstream on master, but
none of the fixes is in a release tag. The 6.2 package in Debian 13
(6.2+dfsg-2+deb13u1), in forky/sid (6.2+dfsg-4), and in Ubuntu 25.10
and newer (6.2+dfsg-3) is still affected. (Debian 12 and Ubuntu 24.04
LTS do not ship libsmb2.)

The upstream fixes:

  09424fa  Do not queue a zero length pad vector, and bound the iovec
           skip loop
           -> stack-buffer-overflow in smb2_read_data(), lib/socket.c:355

  bae5ef5  Validate untrusted lengths and offsets throughout the PDU
           decoders
           -> double free in the query-directory reply decoder error
              path; the same hardening also removes a NULL
              dereference in getinfo_cb_2() (lib/libsmb2.c:1960) when
              a QUERY_INFO reply has Status=SUCCESS and
              OutputBufferLength=0

  57bee9f  Fix heap out-of-bounds read in smb2_decode_file_all_info()
           -> server-controlled FileNameLength read past the receive
              buffer, lib/unicode.c:210 (8-line change)

All four are triggered by a malicious or compromised SMB2 server; none
requires credentials beyond a normal mount.

Evidence: with an ASan/UBSan build of 6.2 I get deterministic reports
for each of them, and for the getinfo_cb_2 issue I also linked against
the static library shipped in libsmb2-dev 6.2+dfsg-3 - the crash still
reproduces with the packaged library, so this is not an artefact of a
local build. Reproducers and sanitizer traces available on request.

Would you consider backporting these three commits to the Debian
package? bae5ef5 is a larger decoder-hardening change and may need
adaptation; 57bee9f is tiny and 09424fa is confined to lib/socket.c.
The package already carries upstream patch series, so this would fit
the existing pattern. I am happy to help test a backported package.

(I have also written to the upstream maintainer about a possible
release, since a new tag would help all downstreams.)

Thanks,
Yuanfu Xie
yuanfuxie@stu.pku.edu.cn

#1151580#10
Date:
2026-11-13 18:00:03 UTC
From:
To:
Hello, Yuanfu Xie,

As you probably know, the fixes have been backported to 6.3 by upstream:

- 09424fa — https://github.com/sahlberg/libsmb2/commit/e2ac2ac797be208c430019aae82fd8be2b3ed057
- bae5ef5 — https://github.com/sahlberg/libsmb2/commit/48f5b87b4bb3ca4c390834f66905898544083ddc
- 57bee9f — https://github.com/sahlberg/libsmb2/commit/588a77951e5b15016f54a7e5eacb5d695ef86106

I intend to upload the 6.3.2 tag soon.

Thank you for your help!

#1151580#15
Date:
2026-11-13 18:34:25 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
libsmb2, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1151580@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matheus Polkorny <polkorny@debian.org> (supplier of updated libsmb2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 13 Nov 2026 14:25:38 -0300
Source: libsmb2
Architecture: source
Version: 6.3.2+dfsg-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org>
Changed-By: Matheus Polkorny <polkorny@debian.org>
Closes: 1151580
Changes:
 libsmb2 (6.3.2+dfsg-1) unstable; urgency=medium
 .
   * New upstream version 6.3.2+dfsg (Closes: #1151580)
     - Thank you Yuanfu Xie!
     - CVE-2026-110712 (heap out-of-bounds read vulnerability)
     - CVE-2026-110713 (heap out-of-bounds read vulnerability)
     - CVE-2026-110714 (integer underflow vulnerability)
     - CVE-2026-115505 (integer overflow vulnerabilities)
   * d/patches:
     - 20-Handle-a-bunch-of-other-compiler-warnings.patch: Update patch
     - CVE-2025-57632-pt4.patch: Update patch
     - fix-discarded-const-warning.patch: Drop merged patch
     - Refresh Patches
   * d/control:
     - Bump debhelper to 14
     - Update uploader email
Checksums-Sha1:
 e929b6207b9927bd03be99b9330ab4ac360a5cd8 2058 libsmb2_6.3.2+dfsg-1.dsc
 1113e03a87e98994f5aab1187a04330ced59f687 194772 libsmb2_6.3.2+dfsg.orig.tar.xz
 b6a3d380d7aeb96b8c91ce888667c49bc596916b 18732 libsmb2_6.3.2+dfsg-1.debian.tar.xz
 c59cd50d4dc8b5f73baa085b6cf2fe2cf6b436c1 8064 libsmb2_6.3.2+dfsg-1_source.buildinfo
Checksums-Sha256:
 2037c16655ea0a680852a4c0b003e48c69d98343eaeabe924cc5310b66f3d952 2058 libsmb2_6.3.2+dfsg-1.dsc
 c4909cd24adab7619ad1d7bbc210b4af8dd5d3e3682c16e3b9d66f4b8ef31b76 194772 libsmb2_6.3.2+dfsg.orig.tar.xz
 07f9274f839115c6f0c63d2b552bd4a0ae64569d7b590dcf2f30757bcc98f163 18732 libsmb2_6.3.2+dfsg-1.debian.tar.xz
 d265cdc3296d1ab0d5be94c1a8c43d0ca8a1a23dcda3221da64c0df323c12b14 8064 libsmb2_6.3.2+dfsg-1_source.buildinfo
Files:
 2c8c4640e3906e121def9ae354cdfe3e 2058 libs optional libsmb2_6.3.2+dfsg-1.dsc
 195a12595fccc22685be1ca2b873fd05 194772 libs optional libsmb2_6.3.2+dfsg.orig.tar.xz
 83128737798abd5fff3ad0346183076c 18732 libs optional libsmb2_6.3.2+dfsg-1.debian.tar.xz
 53811ab069b554d1479441ad55143d95 8064 libs optional libsmb2_6.3.2+dfsg-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcRD/fHLtdypUR2KKShyoWjj77loFAmr3VDoUHHBvbGtvcm55
QGRlYmlhbi5vcmcACgkQShyoWjj77loVVA//btyj3ectxVPG2ZnIQH0HaTdK1y53
VNX0sdgJTzvl3AzKK2F080UJSr8lE0IM0YICXBwBjclHq0C5PDtp38JamfyF80o7
MKeEdsSFmerK5EiFbGGn0m171fXMb5Zg4/N2kJyQCet+FjtTZpBjnFpGGAvCG5W2
QZ6wwy/Oxq/QBGNJBmdaKHrQPTK8pwjdLgfxH0pox4Ua1OSg2Nhsc3r56ca9VLSn
tqPI/JhTskyUXa0ec9jgiFeEdbSYuBk32i06ARCOkrvYfPHIPDzmajq79mpfrxBL
jx397jciHtIzCc0hnA0idEu9Ga6kV6k8asYSdoBaYo2dfJAEu2+HSwc1uQ8KbLTx
1gd7fMgqkGp6XZB/jTeak3dpf+fa/8itZ4gxXUaXHvOTtSI+5yu4pUb11DdWrVZ/
TP2L4zEKLOrxJp47rGj8Ewy+QAOudKZkiigRJSSrw9Y2pLPfjQ8qUMck9/hUsPK6
W/cOyDqfJ4703iUO1B6bQ5CHYy4UJk8w5Z8xiv4qv5Ot/ybCvnahyNSugaJwUlbo
0YKQWcGO1t8RaxBWwE/495AjyBkj5BqBF2+WgAZV8ky9wwXGP2jociB/80Gn7YvV
Kuu4G1SvO0WLOU1olxln8A/ZIw0P618DkLdfPvGYdVheyUFNEQtKSmTNGofb619n
lMlWPpFAq6V6bHM=
=nyqF
-----END PGP SIGNATURE-----