APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.util

public final Class SecurityManager

extends Object
Class Inheritance
Imports
jdk.xml.internal.JdkConstants

This class is a container for parser settings that relate to security, or more specifically, it is intended to be used to prevent denial-of-service attacks from being launched against a system running Xerces. Any component that is aware of a denial-of-service attack that can arise from its processing of a certain kind of document may query its Component Manager for the property (http://apache.org/xml/properties/security-manager) whose value will be an instance of this class. If no value has been set for the property, the component should proceed in the "usual" (spec-compliant) manner. If a value has been set, then it must be the case that the component in question needs to know what method of this class to query. This class will provide defaults for all known security issues, but will also provide setters so that those values can be tailored by applications that care.
Author
Neil Graham, IBM

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
DEFAULT_MAX_OCCUR_NODE_LIMIT

Default value of number of nodes created.

private int
entityExpansionLimit

Entity expansion limit.

private int
private int
maxOccurLimit

W3C XML Schema maxOccurs limit.

Constructor Summary

AccessConstructor and Description
public
SecurityManager()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public int
public int

Returns:

the number of entity expansions permitted in a document
getEntityExpansionLimit
()

Returns the number of entity expansions that the parser permits in a document.

public int

Returns:

the maximum value for maxOccurs other than "unbounded"
getMaxOccurNodeLimit
()

Returns the limit of the number of content model nodes that may be created when building a grammar for a W3C XML Schema that contains maxOccurs attributes with values other than "unbounded".

private void
public void
public void
setEntityExpansionLimit(int
the number of entity expansions permitted in a document
limit
)

Sets the number of entity expansions that the parser should permit in a document.

public void
setMaxOccurNodeLimit(int
the maximum value for maxOccurs other than "unbounded"
limit
)

Sets the limit of the number of content model nodes that may be created when building a grammar for a W3C XML Schema that contains maxOccurs attributes with values other than "unbounded".

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_ELEMENT_ATTRIBUTE_LIMITback to summary
private static final int DEFAULT_ELEMENT_ATTRIBUTE_LIMIT
DEFAULT_ENTITY_EXPANSION_LIMITback to summary
private static final int DEFAULT_ENTITY_EXPANSION_LIMIT
DEFAULT_MAX_OCCUR_NODE_LIMITback to summary
private static final int DEFAULT_MAX_OCCUR_NODE_LIMIT

Default value of number of nodes created. *

entityExpansionLimitback to summary
private int entityExpansionLimit

Entity expansion limit. *

fElementAttributeLimitback to summary
private int fElementAttributeLimit
maxOccurLimitback to summary
private int maxOccurLimit

W3C XML Schema maxOccurs limit. *

Constructor Detail

SecurityManagerback to summary
public SecurityManager()

Default constructor. Establishes default values for known security vulnerabilities.

Method Detail

getElementAttrLimitback to summary
public int getElementAttrLimit()
getEntityExpansionLimitback to summary
public int getEntityExpansionLimit()

Returns the number of entity expansions that the parser permits in a document.

Returns:int

the number of entity expansions permitted in a document

getMaxOccurNodeLimitback to summary
public int getMaxOccurNodeLimit()

Returns the limit of the number of content model nodes that may be created when building a grammar for a W3C XML Schema that contains maxOccurs attributes with values other than "unbounded".

Returns:int

the maximum value for maxOccurs other than "unbounded"

readSystemPropertiesback to summary
private void readSystemProperties()
setElementAttrLimitback to summary
public void setElementAttrLimit(int limit)
setEntityExpansionLimitback to summary
public void setEntityExpansionLimit(int limit)

Sets the number of entity expansions that the parser should permit in a document.

Parameters
limit:int

the number of entity expansions permitted in a document

setMaxOccurNodeLimitback to summary
public void setMaxOccurNodeLimit(int limit)

Sets the limit of the number of content model nodes that may be created when building a grammar for a W3C XML Schema that contains maxOccurs attributes with values other than "unbounded".

Parameters
limit:int

the maximum value for maxOccurs other than "unbounded"