about summary refs log tree commit diff
path: root/cmd.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2013-05-25 19:47:15 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2013-05-25 20:33:28 +0200
commitfe36f84d843cd755c6dab629a0758264de5bcc00 (patch)
treefee8af2ed0f3df2fa9015453ce3e8d721df6a0cd /cmd.h
parentcgitrc.5: information on directory traversal and multiple readme files (diff)
downloadcgit-pink-fe36f84d843cd755c6dab629a0758264de5bcc00.tar.gz
cgit-pink-fe36f84d843cd755c6dab629a0758264de5bcc00.zip
ui-summary: Disallow directory traversal
Using the url= query string, it was possible request arbitrary files
from the filesystem if the readme for a given page was set to a
filesystem file. The following request would return my /etc/passwd file:

http://git.zx2c4.com/?url=/somerepo/about/../../../../etc/passwd
http://data.zx2c4.com/cgit-directory-traversal.png

This fix uses realpath(3) to canonicalize all paths, and then compares
the base components.

This fix introduces a subtle timing attack, whereby a client can check
whether or not strstr is called using timing measurements in order
to determine if a given file exists on the filesystem.

This fix also does not account for filesystem race conditions (TOCTOU)
in resolving symlinks.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'cmd.h')
0 files changed, 0 insertions, 0 deletions
&follow=1'>Add CGI upload program for temp.causal.agencyJune McEnroe 2020-07-10Add The Broken KingdomsJune McEnroe 2020-07-08Add facebook and twitter to title user-agentJune McEnroe This fixes fetching tweets again! https://github.com/thelounge/thelounge/pull/ 3602 (Intentionally breaking the link so GitHub doesn't add a "referenced this PR" thing?) 2020-06-30Tweak causal.agency for mostly no reasonJune McEnroe 2020-06-30Add Ancillary JusticeJune McEnroe 2020-06-26Add password non-manager to planJune McEnroe I've had this idea for years... 2020-06-26Tweak TF2 sensitivities once moreJune McEnroe 2020-06-19Add note about litterbox bot useJune McEnroe 2020-06-19Publish "IRC suite"June McEnroe 2020-06-17Add errors to link.shJune McEnroe