Commit f5ae9463 authored by Floris Bos's avatar Floris Bos

httpd: disallow directory traversal

Signed-off-by: 's avatarFloris Bos <bos@je-eigen-domein.nl>
parent 6836ccb2
...@@ -423,6 +423,14 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen) ...@@ -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 */ /* If we were asked for '/', actually read the file index.vnc */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment