Lab: Exploiting Java deserialization with Apache Commons
Summary: This PortSwigger lab uses a serialization-based session mechanism and loads the Apache Commons Collections library, and it can be exploited without source code access using pre-built gadget chains. The task is to use a third-party tool such as ysoserial to generate a malicious serialized object containing a remote code execution payload, pass it into the website, and delete the morale.txt file from Carlos's home directory, logging in with the credentials wiener:peter.
What you should know: A session cookie that carries a serialized Java object is enough to turn a web request into remote code execution when Apache Commons Collections is on the classpath, and the only tooling the attacker needs is a public gadget-chain generator like ysoserial.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026