1、在php、java代码中xml代码前加入禁用实体解析的代码
php:
libxml_ disable_ entity. loader (true);
¥xml=simplexml_load_string($xmlContent);
java:
DocumentBuilderFactory dbf= DocumentBuilderFactory.newlnstance();
dbf.setExpandEntityReferences(false);
2、过滤用户提交的XML数据
'
''
''(two apostrophe)
""
<
>
]]>
]]>>
<!--/-->
/-->
-->
<!--
<!
<! [CDATA[/]]>
3、使用waf
标签:xml,java,DocumentBuilderFactory,dbf,XXE,防范,php From: https://www.cnblogs.com/L-1906/p/17644782.html