Package org.apache.ofbiz.security
Class SecuredFreemarker
java.lang.Object
org.apache.ofbiz.security.SecuredFreemarker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
containsFreemarkerInterpolation
(String stringToCheck) Analyze if stringToCheck contains a freemarker templatestatic boolean
containsFreemarkerInterpolation
(HttpServletRequest req, HttpServletResponse resp, String uri) static boolean
containsFreemarkerInterpolation
(HttpServletResponse resp, String stringToCheck) sanitizeParameterMap
(Map<String, Object> params) Analyse each entry contains on params.
-
Constructor Details
-
SecuredFreemarker
public SecuredFreemarker()
-
-
Method Details
-
containsFreemarkerInterpolation
public static boolean containsFreemarkerInterpolation(HttpServletRequest req, HttpServletResponse resp, String uri) throws IOException - Throws:
IOException
-
containsFreemarkerInterpolation
public static boolean containsFreemarkerInterpolation(HttpServletResponse resp, String stringToCheck) throws IOException - Parameters:
resp
-stringToCheck
-- Throws:
IOException
-
containsFreemarkerInterpolation
Analyze if stringToCheck contains a freemarker template- Parameters:
stringToCheck
-- Returns:
- true if freemarker template is detected
-
sanitizeParameterMap
Analyse each entry contains on params. If a freemarker template is detected, sanatize it to escape any exploit- Parameters:
params
-- Returns:
- Map with all values sanitized
-