Skip to content

Commit

Permalink
Merge pull request #68 from OpenConext/feature/prevent-xxe
Browse files Browse the repository at this point in the history
Prevent XXE in SPController
  • Loading branch information
MKodde authored Feb 11, 2019
2 parents 87cdb45 + dd11c2d commit f983c4b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SpBundle/Controller/SPController.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ public function assertionConsumerServiceAction(Request $request)
*/
private function toFormattedXml($xml)
{
$previous = libxml_disable_entity_loader(true);
$domxml = new DOMDocument('1.0');
$domxml->preserveWhiteSpace = false;
$domxml->formatOutput = true;
$domxml->loadXML($xml);
libxml_disable_entity_loader($previous);

return $domxml->saveXML();
}
Expand Down

0 comments on commit f983c4b

Please sign in to comment.