🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #1627

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

#1627
From: Yuanfu Xie
Date: Wed, 21 Oct 2026 19:50
54 lines
4457 bytes
Package: libsmb2
Version: 6.2+dfsg-2+deb13u1
Severity: important
Tags: security

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
Technical Details
Message-ID: <NQKtX-72oa-3@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!newsfeed.xs3.de!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!newsfeed.xs3.de!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1151580: libsmb2: please consider backporting three upstream memory-safety fixes
Date: Wed, 21 Oct 2026 21:50:01 +0200
Message-ID: <NQKtX-72oa-3@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Oct 21 19:47:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.45
Reply-To: Yuanfu Xie <yuanfuxie@stu.pku.edu.cn>, 1151580@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: team+pkg-security@tracker.debian.org
X-Debian-Pr-Message: report 1151580
X-Debian-Pr-Package: libsmb2
X-Debian-Pr-Keywords: security
X-Debian-Pr-Source: libsmb2
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0 (Mac OS X Mail 16.0 \(3901.100.1.1.12\))
X-Mailer: Apple Mail (2.3901.100.1.1.12)
X-Hm-Tid: 0aa15ff99f6803a1kunm9c89389655826
X-Hm-Mtype: 10
X-Hm-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly
	tZV1koWUFITzdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkaHU0aVh4ZHUxMSUhCSklISFYeHw
	5VEwETFhoSFyQUDg9ZV1kYEgtZQVlKSk5VSkxKVU9DVUlKSVlXWRYaDxIVHRRZQVlLVUtVS1VLWQ
	Y+
X-Greylist: delayed 303 seconds by postgrey-1.37 at buxtehude; Wed, 21 Oct 2026 19:44:27 UTC
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1997997
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 54
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: Debian Security Tools <team+pkg-security@tracker.debian.org>,
 Matheus Polkorny <mpolkorny@gmail.com>
X-Original-Date: Thu, 22 Oct 2026 03:39:06 +0800
X-Original-Message-ID: <AF3029CE-0669-4B23-BC58-DED8E6D1858D@stu.pku.edu.cn>