Commit 10710949 authored by Christian Beier's avatar Christian Beier

Merge pull request #70 from maxnet/master

httpd: disallow directory traversal
parents f5abd4ab f5ae9463
...@@ -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