刚刚看到推送这篇文章,由这个半年前的 xxe 漏洞: http://www.guancha.cn/TMT/2018_07_04_462639.shtml
联想到 php 写代码调用simplexml_load_string
之前一定要先这么把外部引用实体关掉:
https://github.com/helei112g/payment/blob/v4.1.7/src/Utils/DataParser.php#L56
然后查看了我当前项目里不少三方库( swiftmailer、thenbsp/wechat、flc/alidayu 等)调用simplexml_load_string
之前都没关,我也不知道关掉后会不会有问题
1
mingyun 2018-07-04 22:34:43 +08:00
libxml_disable_entity_loader(true); 这个还真没注意
$data = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); 生成二维码 http://chart.apis.google.com/chart?chs={$widthHeight}x{$widthHeight}&cht=qr&chld={$ecLevel}|{$margin}&chl={$chl} 国内还能用吗? |