Skip to content

Commit

Permalink
Improved: Prevent URL parameters manipulation (OFBIZ-13147)
Browse files Browse the repository at this point in the history
Allows JavaScriptEnabled=Y to pass.

Conflict handled by hand
  • Loading branch information
JacquesLeRoux committed Oct 23, 2024
1 parent 166bbdf commit 84ff5ee
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
String queryString = httpRequest.getQueryString();
if (queryString != null) {
queryString = URLDecoder.decode(queryString, "UTF-8");
if (UtilValidate.isUrl(queryString) || !SecuredUpload.isValidText(queryString, Collections.emptyList())) {
if (UtilValidate.isUrl(queryString)
|| (!SecuredUpload.isValidText(queryString, Collections.emptyList())
&& !queryString.contains("JavaScriptEnabled=Y"))) {
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 84ff5ee

Please sign in to comment.