Skip to content

Commit

Permalink
Improved: Prevent URL parameters manipulation (OFBIZ-13147)
Browse files Browse the repository at this point in the history
Allows Solr tests to pass, so far so good...
  • Loading branch information
JacquesLeRoux committed Oct 23, 2024
1 parent 83f35c9 commit 63201f5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ public void doFilter(HttpServletRequest req, HttpServletResponse resp, FilterCha
String queryString = req.getQueryString();
if (queryString != null) {
queryString = URLDecoder.decode(queryString, "UTF-8");
// wt=javabin allows Solr tests, see https://cwiki.apache.org/confluence/display/solr/javabin
if (UtilValidate.isUrl(queryString)
|| (!SecuredUpload.isValidText(queryString, Collections.emptyList())
&& !queryString.contains("JavaScriptEnabled=Y"))) {
|| !SecuredUpload.isValidText(queryString, Collections.emptyList())
&& !(queryString.contains("JavaScriptEnabled=Y")
|| queryString.contains("wt=javabin"))) {
Debug.logError("For security reason this URL is not accepted", MODULE);
throw new RuntimeException("For security reason this URL is not accepted");
}
Expand Down

0 comments on commit 63201f5

Please sign in to comment.