Skip to content

In-depth lesson · Unsafe deserialisation

Tips for beginners

Every point the Unsafe deserialisation reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 13 of 13
  1. For PHP, build or find a gadget chain in the framework in use. The reports show chains in WordPress core, Laravel and a Symfony package, and phar deserialisation triggered through file operations such as logging settings or an importer. If you can trigger a file operation on a phar, you may not need a direct unserialise call.

    Seen in 5 reports
  2. Start with the language and framework defaults. If the target is Ruby on Rails, look at signed cookies, message verifiers and cache fetches that use the raw option. If it is Java, look at YAML parsing and JSON default typing. If it is PHP, look at unserialise calls and the yaml_parse family. Knowing the default unsafe path saves time.

    Seen in 4 reports
  3. Search for the unsafe variant of a load function in code you can read, and check whether the input is user controlled. The reports name several: YAML load instead of a safe loader, PyYAML unsafe load instead of safe load, SnakeYAML without a safe constructor, and unserialise without an allowed-classes list.

    Seen in 4 reports
  4. Look at import and configuration flows. A CSV importer, a config file, a repository containing a crafted options file, or a checksum file parsed during an upload are all places where structured data is rebuilt into objects. These are often overlooked because they are not obvious API endpoints.

    Seen in 4 reports
  5. For Java targets, probe known servlet and RPC endpoints rather than guessing. The reports mention JBoss JMXInvokerServlet and EJBInvokerServlet, WebSphere SOAP endpoints, JMeter RMI and Dubbo consumers. These are established surfaces where deserialisation is expected.

    Seen in 4 reports
  6. Do not report a sink on its own. A call to an unsafe loader is not a vulnerability unless untrusted input reaches it and there is a plausible chain or side effect. The evidence includes reports where the issue is the full path from input to impact, not the function name alone.

    Seen in 3 reports
  7. Check scope before testing. Many of the reports concern specific products, plugins or versions, and some are about third-party components reached through a host application. Confirm the component and version are in scope, and avoid testing production systems with payloads that could disrupt them.

    Seen in 3 reports
  8. Consider the wider flow. Deserialisation is often one step in a chain with path traversal, file inclusion, SQL injection or SSRF. The reports show combinations that reach command execution or escalate an existing injection. Mapping the whole flow helps you demonstrate impact and avoid a report that is dismissed as theoretical.

    Seen in 3 reports
  9. Remember non-web clients. Thick client applications, Android apps and SDKs also deserialise data, and the reports show token leaks and account takeover through crafted intents or crafted objects. If the program includes a client app, it is worth a look.

    Seen in 3 reports
  10. Check signed and encrypted values. If a secret is committed to a public repository, or can be derived from public information such as an application name, a signed cookie or blob key can become an attacker-controlled serialised object. Search public code for committed secrets before assuming signing is a defence.

    Seen in 2 reports
  11. Show impact with the smallest safe proof. A report is much stronger if you can show a concrete consequence such as command execution, file deletion, token leakage or account takeover, rather than only that an object was created. The reports that were paid describe specific outcomes.

    Seen in 2 reports
  12. Watch for defences that look stronger than they are. A blacklist may not cover the classes in your chain, as one report shows with logback and database driver classes. A patch may be bypassable, as another report shows for a phar deserialisation fix. Test the bypass rather than assuming the fix holds.

    Seen in 2 reports
  13. Use code review where you have source. Static queries can find deserialisation sinks in Java codebases, and reading the code lets you confirm whether input is untrusted and whether a chain exists. The reports include reviews of specific codebases for exactly this reason.

    Seen in 2 reports