Fix required login vulnerability

This commit is contained in:
R0taK 2019-05-02 18:08:56 +09:00
parent e8ec7da47d
commit d5596944b0

View File

@ -46,7 +46,11 @@ public class MapStorageResourceHandler extends AbstractHandler {
int soff = 0, eoff;
// We're handling this request
baseRequest.setHandled(true);
if(core.getLoginRequired()
&& request.getSession(true).getAttribute(LoginServlet.USERID_ATTRIB) == null){
response.sendError(HttpStatus.UNAUTHORIZED_401);
return;
}
if (path.charAt(0) == '/') soff = 1;
eoff = path.indexOf('/', soff);
if (soff < 0) {