diff options
author | Christian Beier <dontmind@freeshell.org> | 2015-04-17 12:07:16 +0200 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2015-04-17 12:07:16 +0200 |
commit | 107109492e37f0b508f55b5b4e4bd8dcfae3d0cf (patch) | |
tree | 846841a83ec80d9ee5afc0342e034cd2c49b1c5a /libvncserver | |
parent | f5abd4ab20641747b6eb12aac20d7a4786363e02 (diff) | |
parent | f5ae94639bad542e6ae2b57495cb975bd8feb45e (diff) | |
download | libtdevnc-107109492e37f0b508f55b5b4e4bd8dcfae3d0cf.tar.gz libtdevnc-107109492e37f0b508f55b5b4e4bd8dcfae3d0cf.zip |
Merge pull request #70 from maxnet/master
httpd: disallow directory traversal
Diffstat (limited to 'libvncserver')
-rw-r--r-- | libvncserver/httpd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libvncserver/httpd.c b/libvncserver/httpd.c index 12d71a8..2a778e7 100644 --- a/libvncserver/httpd.c +++ b/libvncserver/httpd.c @@ -423,6 +423,14 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen) } } + /* Basic protection against directory traversal outside webroot */ + + if (strstr(fname, "..")) { + rfbErr("httpd: URL should not contain '..'\n"); + rfbWriteExact(&cl, NOT_FOUND_STR, strlen(NOT_FOUND_STR)); + httpCloseSock(rfbScreen); + return; + } /* If we were asked for '/', actually read the file index.vnc */ |