提交 ef2c0dc1 编写于 作者: D Daniel Beck

[FIX SECURITY-233] Remove multipart form exception from crumb filter

上级 a78b13e7
......@@ -80,8 +80,8 @@ public class CrumbFilter implements Filter {
LOGGER.log(Level.WARNING, "Found invalid crumb {0}. Will check remaining parameters for a valid one...", crumb);
}
}
// Multipart requests need to be handled by each handler.
if (valid || isMultipart(httpRequest)) {
if (valid) {
chain.doFilter(request, response);
} else {
LOGGER.log(Level.WARNING, "No valid crumb was included in request for {0}. Returning {1}.", new Object[] {httpRequest.getRequestURI(), HttpServletResponse.SC_FORBIDDEN});
......
......@@ -117,6 +117,11 @@ var crumb = {
var div = document.createElement("div");
div.innerHTML = "<input type=hidden name='"+this.fieldName+"' value='"+this.value+"'>";
form.appendChild(div);
if (form.action.indexOf("?") != -1) {
form.action = form.action+"&"+this.fieldName+"="+this.value;
} else {
form.action = form.action+"?"+this.fieldName+"="+this.value;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册