Reading
PentestingHere Academy
23 Sep 2026
What it is
Deserializing attacker-controlled data means reconstructing whatever objects that data claims to describe, magic methods included. If the right class happens to be available, its constructor or destructor runs with the fields you chose.
The labs here
- MemoryLane preferences cookie gadget: a cookie is passed straight to
PHP's
unserialize(), with no restriction on which classes it can build. AThemeCacheclass's destructor writes a file to disk using fields you control, which is enough to drop a web shell. - ClubTrack bulk-import gadget chain: a longer chain this time. A
MemberSessionobject's destructor calls->flush()on whatever object you set as its logger. Point that logger field at anActivityLoggerinstead, andflush()writes attacker-controlled content to a file of your choosing.