mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS
synced 2024-11-13 17:57:07 +00:00
Prevent xxe when loading feed XML
Turn off external entity loading while parsing feed xml. bug: 46932 Change-Id: I41006fc10f2da1357d57c1566518c86351f522f1
This commit is contained in:
parent
00f05c4849
commit
05e4e8fa64
|
@ -508,7 +508,10 @@ class RSSParser {
|
|||
}
|
||||
|
||||
wfSuppressWarnings();
|
||||
// Prevent loading external entities when parsing the XML (bug 46932)
|
||||
$oldDisable = libxml_disable_entity_loader( true );
|
||||
$this->xml->loadXML( $raw_xml );
|
||||
libxml_disable_entity_loader( $oldDisable );
|
||||
wfRestoreWarnings();
|
||||
|
||||
$this->rss = new RSSData( $this->xml );
|
||||
|
|
Loading…
Reference in a new issue