When using XStreamMarshaller with spring package, I get the following message:
Security framework of XStream not initialized, XStream is probably vulnerable.
First attempt: According to the documentation, I tried to reset all permissions, but I still have the same message. In addition, I do not have a security error when parsing XML files ... Therefore, I believe that this code simply does not work. Here's a sample code:
XStreamMarshaller marshaller = new XStreamMarshaller(); marshaller.getXStream().addPermission(NoTypePermission.NONE);
Second attempt: I also tried using the setSupportedClasses method, but it does not work (I still get a vulnerability message and unsupported classes are still unmarked correctly):
XStreamMarshaller marshaller = new XStreamMarshaller(); marshaller.setSupportedClasses(FooBar.class);
How to set security permissions using XStreamMarshaller?
Note: according to this thread , the Security Framework was introduced with 1.4.7, and it is still optional .... But it will be mandatory for XStream 1.5.0!
Used version of XStream: 1.4.10
Spring Version Lot Used: 4.0.1
For information, I use spring boot (but I'm not sure if this is relevant here)
source share