XStream 1.4.10 警告: Security framework of XStream not initialized, XStream is probably vulnerable


參考:www.fengyunxiao.cn

 

XStream 1.4.10 出現警告:Security framework of XStream not initialized, XStream is probably vulnerable.

意思是:xstream 的安全框架沒有初始化,xstream 容易受攻擊。

解決方法:xStream對象設置默認安全防護,同時設置允許的類

 

XStream xStream = new XStream();
XStream.setupDefaultSecurity(xStream);
xStream.allowTypes(new Class[]{Test.class, Test2.class}); // 要關聯的類

 

該警告應該只有新版的XStream會出現,感覺這種設計並不好。

參考:www.fengyunxiao.cn


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM