Article View: linux.debian.bugs.dist
Article #6131Bug#1155308: wsdd2: remote crash via HTTP header split across TCP segments
From: Sven
Date: Wed, 25 Nov 2026 13:50
Date: Wed, 25 Nov 2026 13:50
95 lines
5532 bytes
5532 bytes
Package: wsdd2
Version: 1.8.7+dfsg-1.2
Severity: important
Tags: security upstream fixed-upstream
X-Debbugs-Cc: team@security.debian.org
Dear Maintainer,
this is a remotely triggerable crash in wsdd2, separate from #1145007 and
not fixed by the two patches attached there. I reported it to the security
team first; they asked me to file it publicly now. It is already fixed in
the most recent upstream fork (see "Fixed upstream" below).
Affected
--------
- wsdd2 1.8.7+dfsg-1.2 (trixie, sid): crash reproduced with the official
amd64 binary from the archive.
- wsdd2 1.8.7+dfsg-1.1 (bookworm): same upstream tarball and code; not run.
The crash
---------
wsd.c, wsd_parse_http_header(), TCP port 3702 (WSD metadata exchange over
HTTP). When the header is incomplete after the first recv(), the function
moves the unparsed rest to the start of the buffer, reads more data and
jumps back to "again:", but it does not reset the parse pointer p to buf.
On the next pass "len -= (p - buf)" underflows and memmove() is called with
a huge size on the 10000-byte buffer. With the Debian build, _FORTIFY_SOURCE
turns this into "*** buffer overflow detected ***: terminated" (SIGABRT).
I see no path to code execution, but the daemon is gone until restarted.
Trigger: two TCP segments to port 3702, e.g.
1. "POST /<endpoint-uuid> HTTP/1.1\r\n"
2. "Content-Type: application/soap+xml\r\n"
The endpoint UUID is not a secret (it is in every Hello multicast and in the
XAddrs of every ProbeMatch reply). No authentication is involved. A
legitimate client that happens to send its header in more than one segment
crashes the daemon as well; I reproduced that with a well-formed
WS-Transfer Get request split into three segments.
Reproducer (Python 3, against a test instance at $IP):
import socket, re, time
ip = "$IP"
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); s.settimeout(2)
s.sendto(b"<wsa:Action>http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe"
b"</wsa:Action><wsa:MessageID>x</wsa:MessageID>", (ip, 3702))
path = re.search(rb"<wsd:XAddrs>http://[^/]+(/[^<]+)<", s.recvfrom(65535)[0]).group(1)
c = socket.create_connection((ip, 3702))
c.sendall(b"POST " + path + b" HTTP/1.1\r\n"); time.sleep(0.3)
c.sendall(b"Content-Type: application/soap+xml\r\n"); time.sleep(0.5)
Fixed upstream
--------------
Fixed in the fork github.com/pesa1234/wsdd2, commit "Fix fragmented HTTP
header buffer compaction" (2026-08-22), released in 1.9.2. That fix resets
the parse pointer after the memmove, additionally guards the length
underflow (returns 400 on an inconsistent header state) and caps the header
size. The minimal equivalent is a one-line change:
--- a/wsd.c
+++ b/wsd.c
@@ -955,6 +955,7 @@
memmove(buf, p, len -= (p - buf));
buf[len] = '\0';
+ p = buf;
if (!eoh) { /* Have not reached end of header. */
ssize_t len2 = recv(fd, buf + len, bsize - len - 1, 0);
The same fork also already contains the two #1145007 fixes and a rework of
the WSD TCP handling, so moving the Debian package to it would address this
bug along with #1145007.
Workaround until a fixed package is available: run wsdd2 with "-w" and
restrict ports 3702/tcp and 3702/udp to the local network (firewall or a
systemd drop-in with IPAddressAllow=), and let systemd restart the service
(Restart=always). This limits exposure but does not prevent the crash from
inside the LAN.
Method: Debian source 1.8.7+dfsg-1.2 (checksums verified against the .dsc),
built with -fsanitize=address,undefined and run as an unprivileged user;
the crash was also confirmed with the unmodified binary from the
wsdd2_1.8.7+dfsg-1.2_amd64.deb package. I can provide the test harness.
Regards
Sven
Technical Details
Message-ID:
<O3lxL-e4Q8-3@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Sven <svenj27@proton.me> Newsgroups: linux.debian.bugs.dist Subject: Bug#1155308: wsdd2: remote crash via HTTP header split across TCP segments Date: Wed, 25 Nov 2026 14:50:01 +0100 Message-ID: <O3lxL-e4Q8-3@gated-at.bofh.it> X-Original-To: "submit@bugs.debian.org" <submit@bugs.debian.org> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Wed Nov 25 13:49:12 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.451 Reply-To: Sven <svenj27@proton.me>, 1155308@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: team@security.debian.org, mfv@debian.org X-Debian-Pr-Message: report 1155308 X-Debian-Pr-Package: wsdd2 X-Debian-Pr-Keywords: fixed-upstream security upstream X-Debian-Pr-Source: wsdd2 Feedback-ID: 237336784:user:proton X-Pm-Message-ID: 1c9e54976d38a3170422076ccea05d656389a809 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2004965 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 95 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Wed, 25 Nov 2026 13:38:19 +0000 X-Original-Message-ID: <dNvBh81MCNlMXOOJhZhUgTYf_inVcoUJ_loEWMf_zJLfwtd6D9O4b4GdwjAIotGstNfdytdkpUZjhUCqJO7MYXHk-_CXuJPiOF5TIgoYcRY=@proton.me>