By default, XStream allows for arbitrary classes to be unmarshalled, which can result in security vulnerabilities. As such, it isnot recommended to use theXStreamMarshallerto unmarshal XML from external sources(i.e. the Web), as this can result insecurity vulnerabilities. If you do use theXStreamMarshallerto unmarshal XML from an external source, set thesupportedClassesproperty on theXStreamMarshaller, like so:...This will make sure that only the registered classes are eligible for unmarshalling.Additionally, you can registercustom convertersto make sure that only your supported classes can be unmarshalled. You might want to add aCatchAllConverteras the last converter in the list, in addition to converters that explicitly support the domain classes that should be supported. As a result, default XStream converters with lower priorities and possible security vulnerabilities do not get invoked. |