Top Description Constructors Methods
com.thoughtworks.xstream.core

public Class SecurityUtils

extends Object
Class Inheritance
Imports
com.thoughtworks.xstream.XStream, com.thoughtworks.xstream.converters.ConversionException, .UnmarshallingContext, com.thoughtworks.xstream.security.InputManipulationException

Utility functions for security issues.
Author
Jörg Schaible
Since
1.4.19

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
checkForCollectionDoSAttack(final UnmarshallingContext
the unmarshalling context
context
,
final long
the timestamp just before the element was added to the collection or map
start
)

Check the consumed time adding elements to collections or maps.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SecurityUtilsback to summary
public SecurityUtils()

Method Detail

checkForCollectionDoSAttackback to summary
public static void checkForCollectionDoSAttack(final UnmarshallingContext context, final long start)

Check the consumed time adding elements to collections or maps. Every custom converter should call this method after an unmarshalled element has been added to a collection or map. In case of an attack the operation will take too long, because the calculation of the hash code or the comparison of the elements in the collection operate on recursive structures.

Parameters
context:UnmarshallingContext

the unmarshalling context

start:long

the timestamp just before the element was added to the collection or map

Since
1.4.19