Fixed XSS in Internal Error page

Adding a </pre><xss> to an URL that triggered an internal error could be used
to facilitate an XSS attack
This commit is contained in:
Risto Lahtela 2021-01-24 10:58:24 +02:00
parent d8626f37a7
commit 5c49e95c7d
2 changed files with 3 additions and 3 deletions

View File

@ -137,8 +137,8 @@ public class ResponseFactory {
.build();
}
public Response internalErrorResponse(Throwable e, String s) {
return forInternalError(e, s);
public Response internalErrorResponse(Throwable e, String cause) {
return forInternalError(e, cause);
}
public Response networkPageResponse() {

View File

@ -146,7 +146,7 @@ public class ResponseResolver {
throw e; // Pass along
} catch (Exception e) {
errorLogger.log(L.ERROR, e, ErrorContext.builder().related(request).build());
return responseFactory.internalErrorResponse(e, request.getPath().asString());
return responseFactory.internalErrorResponse(e, "Failed to get a response");
}
}