Control: retitle -1 shellinabox: --static-file directory traversal guard 
ineffective

On Fri, Nov 06, 2026 at 03:37:38AM +0200, Alexandru-Ionut Jipa wrote:
> Done, both filed upstream:
> 
>   issue: https://github.com/shellinabox/shellinabox/issues/541
>   PR:    https://github.com/shellinabox/shellinabox/pull/540
> 
> The PR carries the strchr()-based variant (no glibc dependency), tested
> on an unmodified 4f0ecc3 build with the same request matrix as before;
> both reference #1153131 and your patch.

Excellent, thanks for that!

What makes you think this is a "regression", per the bug title? This
behaviour seems to have been present since this logic was first released
in this upstream commit:

commit aab20f5ed00104c8bc9d12d362085634ff64dead
Author: zodiac <zodiac@0da03de8-d603-11dd-86c2-0f8696b7b6f9>
Date:   Mon Dec 29 23:57:07 2008 +0000

    First public release of the version 2.0 rewrite. This is the
    first release of ShellInABox that supports an AJAX interface
    instead of the original Java applet.
    
    
    git-svn-id: https://shellinabox.googlecode.com/svn/trunk@2 
0da03de8-d603-11dd-86c2-0f8696b7b6f9

I have suggested an alternative title but feel free to refine further it
you think it is inadequate.

I have come up with a simple reproducer that works from a bash prompt
in Linux using the packaged binary:

  mkdir /tmp/x
  unshare -rmn shellinaboxd -t -u 0 -g 0 --static-file /static:/tmp &
  nsenter -t $! -U -n --preserve-credentials
  ip link set up lo
  curl --path-as-is http://localhost:4200/static/x/../../etc/os-release
  exit
  kill %1

This will print the given file when the bug is present and return a 404
response when fixed.

Reply via email to