nyx/tests/fixtures/xxe/php/unsafe_xxe.php

7 lines
245 B
PHP
Raw Permalink Normal View History

2026-05-07 01:29:31 -04:00
<?php
// Unsafe: $_GET['xml'] flows into simplexml_load_string with the LIBXML_NOENT
// flag, enabling external-entity expansion (XXE).
$xml = $_GET['xml'];
$doc = simplexml_load_string($xml, "SimpleXMLElement", LIBXML_NOENT);
echo $doc->title;