🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Bug#1153334: trixie-pu: package shellinabox/2.21+deb13u1 (pre-approval)

#3581
From: Andrew Bower
Date: Sat, 07 Nov 2026 12:20
123 lines
6167 bytes
--KSekjwZV8K5mt71x
Content-Type: multipart/mixed; boundary="JqRF7IVSVCefShH2"
Content-Disposition: inline

--JqRF7IVSVCefShH2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

shellinabox 2.21+deb13u1 fixes security defect #1153131, an ineffective
directory traversal guard.

[ Reason ]
The --static-file option fails to detect path segments including '..',
enabling access to resources outside the hierarchy intended by the
user starting the service.

This bug has been present in all versions of the package in Debian
except for 2.21+really2.21-3, which fixes this bug in sid.

[ Impact ]
Unintended access to files for users of shellinabox in trixie who use
this option to expose a directory.

[ Tests ]
Manual reproducer (documented on the bug) confirms the defect and its
resolution using the packaged daemon.

The bug poster has also tested the underlying patch in various
scenarios.

[ Risks ]
Risk of regressions. The code change is very small and has additionally
been scrutinised by the bug reporter.

[ 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 ]
The existing code to guard against directory traversal escape is patched
to perform its job correctly by advancing past the directory separator
before testing for the forbidden path segment.

In trixie this is a native package so the patch is applied directly
rather than via quilt as it is in sid.

[ Other info ]
The security team has reviewed the bug and the debdiff and advised to
propose this fix via a regular stable update for the forthcoming trixie
point release.

--JqRF7IVSVCefShH2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=shellinabox_2.21+deb13u1.debdiff
Content-Transfer-Encoding: quoted-printable

diff -Nru shellinabox-2.21/debian/changelog shellinabox-2.21+deb13u1/debian=
/changelog
--- shellinabox-2.21/debian/changelog	2018-09-09 20:10:40.000000000 +0100
+++ shellinabox-2.21+deb13u1/debian/changelog	2026-11-06 23:30:29.000000000=
 +0000
@@ -1,3 +1,10 @@
+shellinabox (2.21+deb13u1) trixie; urgency=3Dhigh
+
+  * Fix ineffective --static-file path traversal guard (Closes: #1153131)
+    Thanks: Alexandru-Ionut Jipa
+
+ -- Andrew Bower <andrew@bower.uk>  Fri, 06 Nov 2026 23:30:29 +0000
+
 shellinabox (2.21) unstable; urgency=3Dmedium
=20
   * Patched DoS vulnerability reported by Imre Rad.
diff -Nru shellinabox-2.21/shellinabox/externalfile.c shellinabox-2.21+deb1=
3u1/shellinabox/externalfile.c
--- shellinabox-2.21/shellinabox/externalfile.c	2015-07-24 03:12:50.0000000=
00 +0100
+++ shellinabox-2.21+deb13u1/shellinabox/externalfile.c	2026-11-06 23:30:05=
=2E000000000 +0000
@@ -100,8 +100,8 @@
           httpSendReply(http, 404, "File not found", NO_MSG);
           return HTTP_DONE;
         }
-        ptr                =3D strchr(ptr + 1, '/');
-      } while (ptr);
+        ptr                =3D strchrnul(ptr, '/');
+      } while (*ptr++); // Point past the dir sep if found
     }
=20
     // Open file for reading

--JqRF7IVSVCefShH2--

--KSekjwZV8K5mt71x
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEMKYZL6LI55lncG11uqgO2W94h+kFAmrvFXMACgkQuqgO2W94
h+nQ5RAAkJR3HGEvfy6GlP3AYnCrRrSEbCbdmLRvMovIUYDtL/PvJKwwS2jGwf0M
3ludiAeKgbWjhcz6vO825wHNGU5oOwobymNn1OQ5PlHoPiYMJzfg/CtqFptKHb5O
4sYJSuTJMiCgvqICJpdHKObtFE+89XplVPOHPdzV9Bo8nXK19RP0RL0cp1yGCg0J
RCKk1S/DgH56Gk3Rr1LlSMtg9OxAZaIy1ND+JRgI716LvRzZ/42yV+Vn3I0MfJvb
z7sQaH/OQYlljqLpIqaDrtkRfbOb5SSb21m4z2JjCkR2YGEm5Wf3wfSagz7aV5o3
GlfLwLtbUUIUdVhI6umt8lXCBP3Tx00nf6BTRjeixqBTR+GW7CIXvD1fWZgiwf5a
jGy2M0Ehahv4MYaB5CKpGAIHeCIsr0kd2vSGdUzm9xvf8fbG1QxhLPghRzZm14Yf
8683b+0mlHmRGprUw4h4u+yjuR4S8JeEEixw0f1MjAkb3dc6x2H5+Gp0fdZwSimH
tIAHuiSNqMCjvKLL4lfb1HnZV/F5DHYFC7A5SPKMPCNNIQoI7EYKsxmNRhOiz9fF
p+HnDQ5J9VGznpyoBtZ+ggYFG3HRDdeGmLAegGFO/2ezWeOfz+4lEKCLhHNX4aiM
mGEsx9Y6038OSgxACr1D31VNwNHOIer9zN+Lwh6X8ekOJOp/kgo=
=8Bdd
-----END PGP SIGNATURE-----

--KSekjwZV8K5mt71x--
Technical Details
Message-ID: <NWNyN-ao9d-5@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!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!2.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
From: Andrew Bower <andrew@bower.uk>
Newsgroups: linux.debian.bugs.dist,linux.debian.devel.release
Subject: Bug#1153334: trixie-pu: package shellinabox/2.21+deb13u1 (pre-approval)
Date: Sat, 07 Nov 2026 13:20:02 +0100
Message-ID: <NWNyN-ao9d-5@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  7 12:13:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.45
Reply-To: Andrew Bower <andrew@bower.uk>, 1153334@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: shellinabox@packages.debian.org, debian-release@lists.debian.org
X-Debian-Pr-Message: report 1153334
X-Debian-Pr-Package: release.debian.org
X-Debian-Pr-Keywords: trixie
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="KSekjwZV8K5mt71x"
Content-Disposition: inline
X-Reportbug-Version: 13.2.0+nmu1
User-Agent: Mutt/2.4.1 (2026-07-04)
X-Blackcat-Spam-Score: -20
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2001252
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 123
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Sat, 7 Nov 2026 12:11:53 +0000
X-Original-Message-ID: <au8Vcw8SuRJG2I8Q@shenstone.ab8.net>