This PR improves the Symfony/RCE11 gadget chain by removing the redundant dependency on symfony/browserkit.
In the original gadget chain, \Symfony\Component\BrowserKit\Response was used to trigger a foreach() loop in __toString().
However, I realised that some Symfony-based applications do not actually have symfony/browserkit installed. After taking a quick look at the Symfony/RCE11 gadget chain, it would appear that the \Symfony\Component\Validator\ConstraintViolationList class has the following __toString() implementation:
public function __toString()
{
$string = '';
foreach ($this->violations as $violation) { // triggers getIterator()
$string .= $violation."\n";
}
return $string;
}
This makes \Symfony\Component\Validator\ConstraintViolationList a suitable candidate gadget, rendering the usage of the \Symfony\Component\BrowserKit\Response redundant.
Unsurprisingly, this minor improvement does not affect the range of versions the gadget chain will work on when tested with test-gc-compatibility.py since \Symfony\Component\Validator\ConstraintViolationList was already used as part of the original gadget chain.
Great work on discovering the universal gadget chain by the way!
Cheers!
Hi,
This PR improves the Symfony/RCE11 gadget chain by removing the redundant dependency on
symfony/browserkit
.In the original gadget chain,
\Symfony\Component\BrowserKit\Response
was used to trigger aforeach()
loop in__toString()
.However, I realised that some Symfony-based applications do not actually have
symfony/browserkit
installed. After taking a quick look at the Symfony/RCE11 gadget chain, it would appear that the\Symfony\Component\Validator\ConstraintViolationList
class has the following__toString()
implementation:This makes
\Symfony\Component\Validator\ConstraintViolationList
a suitable candidate gadget, rendering the usage of the\Symfony\Component\BrowserKit\Response
redundant.Unsurprisingly, this minor improvement does not affect the range of versions the gadget chain will work on when tested with
test-gc-compatibility.py
since\Symfony\Component\Validator\ConstraintViolationList
was already used as part of the original gadget chain.Great work on discovering the universal gadget chain by the way! Cheers!