Class XMLProtectionInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.xmlprotection.XMLProtectionInterceptor
- All Implemented Interfaces:
Interceptor
- Description
- Prohibits XML documents to be passed through that look like XML attacks on older parsers. Too many attributes, too long element names are such indications. DTD definitions will simply be removed.
- Topic
- 6. Security
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
FieldsFields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(Exchange exc) voidsetMaxAttributeCount(int maxAttributeCount) voidsetMaxElementNameLength(int maxElementNameLength) voidsetRemoveDTD(boolean removeDTD) Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, handleResponse, init, init, setDisplayName, setFlow
-
Field Details
-
X_PROTECTION
- See Also:
-
-
Constructor Details
-
XMLProtectionInterceptor
public XMLProtectionInterceptor()
-
-
Method Details
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
setMaxAttributeCount
public void setMaxAttributeCount(int maxAttributeCount) - Default
- 1000
- Description
- If an incoming request exceeds this limit, it will be discarded.
-
setMaxElementNameLength
public void setMaxElementNameLength(int maxElementNameLength) - Default
- 1000
- Description
- If an incoming request exceeds this limit, it will be discarded.
-
setRemoveDTD
public void setRemoveDTD(boolean removeDTD) - Default
- true
- Description
- Whether to remove the DTD from incoming requests.
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-