🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.devel.release
Article #1097

Bug#1154749: trixie-pu: package weborf/1.5-1

#1097
From: Salvo 'LtWorf' Tomaselli
Date: Sun, 22 Nov 2026 00:00
191 lines
8565 bytes
This is a multi-part MIME message sent by reportbug.


--===============7692656544218073358==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: weborf@packages.debian.org, ltworf@debian.org
Control: affects -1 + src:weborf
User: release.debian.org@packages.debian.org
Usertags: pu

This is to close some security vulnerabilities.

Security team never replied to me for the past few days.

[ Reason ]
Closes some security vulnerabilities.

[ Impact ]
Depending on configuration, possible remote access.

[ Tests ]
The full upstream change includes tests to cover the changes.

[ Risks ]
Code is not that complicated, but closes some holes.

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
3 patches

One adds a check that authentication is enabled on MOVE and COPY HTTP methods.

One forbids ../ in "Destination" headers

One forbids having \r and \n characters in URLs

--===============7692656544218073358==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="weborf_diff"

diff -Nru weborf-1.5/debian/changelog weborf-1.5/debian/changelog
--- weborf-1.5/debian/changelog	2025-02-18 22:26:41.000000000 +0100
+++ weborf-1.5/debian/changelog	2026-11-21 16:24:16.000000000 +0100
@@ -1,3 +1,9 @@
+weborf (1.5-1+deb13u1) trixie; urgency=medium
+
+  * Fix security issues (https://johnjean.io/advisories/weborf-unauthenticated-remote-code-execution/)
+
+ -- Salvo 'LtWorf' Tomaselli <ltworf@debian.org>  Sat, 21 Nov 2026 16:24:16 +0100
+
 weborf (1.5-1) unstable; urgency=low
 
   * Bump standards version
diff -Nru weborf-1.5/debian/patches/0001-Prevent-injecting-r-n-sequences-into-the-URL.patch weborf-1.5/debian/patches/0001-Prevent-injecting-r-n-sequences-into-the-URL.patch
--- weborf-1.5/debian/patches/0001-Prevent-injecting-r-n-sequences-into-the-URL.patch	1970-01-01 01:00:00.000000000 +0100
+++ weborf-1.5/debian/patches/0001-Prevent-injecting-r-n-sequences-into-the-URL.patch	2026-11-17 00:52:52.000000000 +0100
@@ -0,0 +1,45 @@
+From de943f29af565ba820340d14dd5c9d5d4815679d Mon Sep 17 00:00:00 2001
+From: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
+Date: Tue, 17 Nov 2026 00:40:09 +0100
+Subject: [PATCH 1/3] Prevent injecting \r\n sequences into the URL
+
+---
+ auth.c     | 2 +-
+ instance.c | 8 ++++++--
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/auth.c b/auth.c
+index fc1eb2d..1eea0da 100644
+--- a/auth.c
++++ b/auth.c
+@@ -1,6 +1,6 @@
+ /*
+ Weborf
+-Copyright (C) 2010  Salvo "LtWorf" Tomaselli
++Copyright (C) 2010, 2026 Salvo "LtWorf" Tomaselli
+ 
+ Weborf is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+diff --git a/instance.c b/instance.c
+index 0e1da98..86cc56f 100644
+--- a/instance.c
++++ b/instance.c
+@@ -104,9 +104,13 @@ The url will never be longer than the original one.
+ static inline void modURL(char* url, bool params) {
+     replaceEscape(url);
+ 
+-    //Prevents the use of .. to access the whole filesystem
+-    if (!params)
++    if (!params) {
++        //Prevents the use of .. to access the whole filesystem
+         strReplace(url,"../",'\0');
++        //Prevents new lines to do header fuckery
++        strReplace(url, "\r", '\0');
++        strReplace(url, "\n", '\0');
++    }
+     //TODO AbsoluteURI: Check if the url uses absolute url, and in that case remove the 1st part
+ }
+ 
+-- 
+2.55.0
+
diff -Nru weborf-1.5/debian/patches/0002-Disallow-COPY-MOVE-methods-unless-authentication-is-.patch weborf-1.5/debian/patches/0002-Disallow-COPY-MOVE-methods-unless-authentication-is-.patch
--- weborf-1.5/debian/patches/0002-Disallow-COPY-MOVE-methods-unless-authentication-is-.patch	1970-01-01 01:00:00.000000000 +0100
+++ weborf-1.5/debian/patches/0002-Disallow-COPY-MOVE-methods-unless-authentication-is-.patch	2026-11-17 00:52:52.000000000 +0100
@@ -0,0 +1,29 @@
+From 59e5a4ad23597d53ed62ce9bfc4068fd14e3fd3b Mon Sep 17 00:00:00 2001
+From: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
+Date: Tue, 17 Nov 2026 00:41:43 +0100
+Subject: [PATCH 2/3] Disallow COPY, MOVE methods unless authentication is
+ enabled
+
+---
+ webdav.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/webdav.c b/webdav.c
+index 959e188..8097181 100644
+--- a/webdav.c
++++ b/webdav.c
+@@ -459,6 +459,11 @@ int mkcol(connection_t* connection_prop) {
+ Webdav method copy.
+ */
+ int copy_move(connection_t* connection_prop) {
++
++    if (weborf_conf.authsock==NULL) {
++        return ERR_FORBIDDEN;
++    }
++
+     struct stat f_prop; //File's property
+     bool check_exists=false;
+     int retval=0;
+-- 
+2.55.0
+
diff -Nru weborf-1.5/debian/patches/0003-Disallow-relative-destination-path-for-COPY-and-MOVE.patch weborf-1.5/debian/patches/0003-Disallow-relative-destination-path-for-COPY-and-MOVE.patch
--- weborf-1.5/debian/patches/0003-Disallow-relative-destination-path-for-COPY-and-MOVE.patch	1970-01-01 01:00:00.000000000 +0100
+++ weborf-1.5/debian/patches/0003-Disallow-relative-destination-path-for-COPY-and-MOVE.patch	2026-11-17 00:52:52.000000000 +0100
@@ -0,0 +1,29 @@
+From b96b39a080fe7adf465148285b243294854db2ab Mon Sep 17 00:00:00 2001
+From: Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>
+Date: Tue, 17 Nov 2026 00:44:20 +0100
+Subject: [PATCH 3/3] Disallow relative destination path for COPY and MOVE
+
+---
+ webdav.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/webdav.c b/webdav.c
+index 8097181..c8fbbde 100644
+--- a/webdav.c
++++ b/webdav.c
+@@ -499,6 +499,12 @@ int copy_move(connection_t* connection_prop) {
+         check_exists=(overwrite[0]!='F');
+     }
+ 
++    // Disallow relative paths in destination
++    if (strstr(dest, "/../")) {
++        retval = ERR_FORBIDDEN;
++        goto escape;
++    }
++
+     //Destination might be like http://localhost/destination or just /destination
+     if (dest[0] != '/') {
+         dest=strstr(dest, host);
+-- 
+2.55.0
+
diff -Nru weborf-1.5/debian/patches/series weborf-1.5/debian/patches/series
--- weborf-1.5/debian/patches/series	2025-02-18 22:26:41.000000000 +0100
+++ weborf-1.5/debian/patches/series	2026-11-21 12:34:02.000000000 +0100
@@ -0,0 +1,3 @@
+0001-Prevent-injecting-r-n-sequences-into-the-URL.patch
+0002-Disallow-COPY-MOVE-methods-unless-authentication-is-.patch
+0003-Disallow-relative-destination-path-for-COPY-and-MOVE.patch

--===============7692656544218073358==--
Technical Details
Message-ID: <O239T-dmuI-1@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod
From: Salvo 'LtWorf' Tomaselli <ltworf@debian.org>
Newsgroups: linux.debian.bugs.dist,linux.debian.devel.release
Subject: Bug#1154749: trixie-pu: package weborf/1.5-1
Date: Sun, 22 Nov 2026 01:00:01 +0100
Message-ID: <O239T-dmuI-1@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Sat Nov 21 23:55:10 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.9
Reply-To: Salvo 'LtWorf' Tomaselli <ltworf@debian.org>, 1154749@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: weborf@packages.debian.org, ltworf@debian.org, debian-release@lists.debian.org
X-Debian-Pr-Message: report 1154749
X-Debian-Pr-Package: release.debian.org
X-Debian-Pr-Keywords: trixie
Content-Type: multipart/mixed; boundary="===============7692656544218073358=="
MIME-Version: 1.0
X-Mailer: reportbug 13.2.0+nmu1
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2003992
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 191
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Sun, 22 Nov 2026 00:52:16 +0100
X-Original-Message-ID: <179530513618.339785.14489356293974925252.reportbug@galatea>