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.
  • Loading branch information
JacquesLeRoux committed Oct 23, 2024
1 parent 612ad73 commit 83f35c9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ public void doFilter(HttpServletRequest req, HttpServletResponse resp, FilterCha
String queryString = req.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 83f35c9

Please sign in to comment.