Cyber Risks · PortSwigger Research

Lab: Arbitrary object injection in PHP

Summary: This PortSwigger lab uses a serialization-based session mechanism that is vulnerable to arbitrary object injection. To solve it, participants must obtain source code access, craft a malicious serialized CustomTemplate object with the lock_file_path attribute set to /home/carlos/morale.txt, and inject it to delete that file.

Key Takeaway: The exercise shows that a session cookie carrying serialized PHP objects can be turned into a file-deletion primitive against a path like /home/carlos/morale.txt, so any application that deserializes user-controlled session data is handing attackers a direct route to server-side file operations.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related