← PHP / Laravel · Contents

PHP-093 / Advanced

Allowing object tags in a YAML parser (Symfony YAML)

A08:2021 Software and Data Integrity Failures · CWE-502 Deserialization of Untrusted Data

Why is this a problem?

The !php/object tag creates an object and executes a gadget chain.

How to fix it

php
$data = Yaml::parse($request->getContent());   // No object flags; JSON is recommended for trusted input

Further reading