Class XMLProtector
java.lang.Object
com.predic8.membrane.core.interceptor.xmlprotection.XMLProtector
Filters XML streams, removing potentially malicious elements:
- DTDs can be removed.
- The length of element names can be limited.
- The number of attibutes per element can be limited.
protect(InputStreamReader) returns false, an unrecoverable error has
occurred (such as not-wellformed XML or an element name length exceeded the limit),
the OutputStreamWriter is left at this position: It should be discarded and
an error response should be returned to the requestor.-
Constructor Summary
ConstructorsConstructorDescriptionXMLProtector(OutputStreamWriter osw, boolean removeDTD, int maxElementNameLength, int maxAttibuteCount) -
Method Summary
-
Constructor Details
-
XMLProtector
public XMLProtector(OutputStreamWriter osw, boolean removeDTD, int maxElementNameLength, int maxAttibuteCount) throws Exception - Throws:
Exception
-
-
Method Details
-
protect
Is XML secure?- Parameters:
isr- Stream with XML- Returns:
- false if there is any security problem in the XML
- Throws:
XMLProtectionException- if there are critical issues like external entity references
-