Cyber Risks · PortSwigger Research

Lab: Using PHAR deserialization to deploy a custom gadget chain

Summary: A PortSwigger Web Security Academy lab demonstrates achieving remote code execution without explicit deserialization by combining PHAR deserialization with a custom gadget chain. The lab's website uses the Twig template engine, and the technique passes a server-side template injection payload through a phar:// stream to delete the morale.txt file from Carlos's home directory.

Bottom line: The exercise shows that PHAR deserialization can turn a file-handling path into code execution even where no deserialization call is visible, so a single phar:// stream reaching a filesystem function is the stake a security leader should weigh.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related