Class ParameterEnforcer
- java.lang.Object
-
- com.atlassian.confluence.impl.webapp.security.enforcer.ParameterEnforcer
-
- All Implemented Interfaces:
SecurityEnforcer
public final class ParameterEnforcer extends Object implements SecurityEnforcer
Enforces validations on request parameters such as absence of path traversal sequences.- Since:
- 8.8
-
-
Field Summary
-
Fields inherited from interface com.atlassian.confluence.impl.webapp.security.SecurityEnforcer
LOGIN_PATH, NOT_PERMITTED_PATH
-
-
Constructor Summary
Constructors Constructor Description ParameterEnforcer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enforce(ConfluenceUser user, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Enforcement action that should be taken whenSecurityEnforcer.shouldEnforce(com.atlassian.confluence.user.ConfluenceUser, com.atlassian.confluence.impl.webapp.security.MappedAction, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
returnstrue
.boolean
shouldEnforce(ConfluenceUser user, MappedAction mappedAction, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Whilst Tomcat already decodes request parameters, there is potential for bad product code to re-decode them.
-
-
-
Method Detail
-
shouldEnforce
public boolean shouldEnforce(ConfluenceUser user, MappedAction mappedAction, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Whilst Tomcat already decodes request parameters, there is potential for bad product code to re-decode them. We thus preempt such re-decoding to ensure that no multi-encoded forbidden character sequences exist.- Specified by:
shouldEnforce
in interfaceSecurityEnforcer
- Returns:
true
if the request contains forbidden request parameters
-
enforce
public void enforce(ConfluenceUser user, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Description copied from interface:SecurityEnforcer
Enforcement action that should be taken whenSecurityEnforcer.shouldEnforce(com.atlassian.confluence.user.ConfluenceUser, com.atlassian.confluence.impl.webapp.security.MappedAction, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
returnstrue
.- Specified by:
enforce
in interfaceSecurityEnforcer
- Throws:
IOException
-
-