An attacker without an account can send JSON requests of ordinary size that keep a PHP worker busy for a long time, burning CPU and memory. A handful sent at once can use up every worker and take your app offline. Laravel rates it high.

How it works

TrimStrings and ConvertEmptyStringsToNull walk through every value in a request's input. For each nested value they build its full key name by joining it to its parent's key. With crafted input, that key building grows far faster than the request itself, so a small body costs far more work than its size suggests. Laravel registers both as global middleware, so they run on every request, before routing and authentication. See the Laravel advisory.

An app that has removed both middleware, and has none of its own built on TransformsRequest, isn't affected. The fix counts the key bytes built for each request and stops at 20 MB with a 413 error. A subclass can change that limit with $maxKeyBytes.