Cardboard Iguana Security

RCE via XXE in PHP

If you're dealing with PHP, and if the PHP expect module is loaded, and if XML inputs aren't properly sanitized, then defining a SYSTEM entity with the value of expect://$COMMAND will get you RCE via XXE.

<?xml version="1.0"?>
<!DOCTYPE root [<!ENTITY xxerce SYSTEM "expect://id">]>
<root>&xxerce;</root>

Don't expect to run into this often however, as this combination of factors is pretty rare.

RCE via XXE in PHP
Interactive graph
On this page
RCE via XXE in PHP