CsrfFilter returns 500 on malformed form body, allowing log injection
Description
With micronaut-security-csrf at its defaults, an unauthenticated client can write lines of its choosing into the application log at ERROR level, simply by POSTing a form body that contains an invalid percent escape such as %zz to /login or any other anonymous route. Instead of the usual 401/403, the server answers 500 and logs the raw request body, line feeds included, along with a stack trace. The controller is never reached, so CSRF protection still holds and nothing is disclosed to the sender.
Affected and patched versions
The following ranges cover stable releases.
| Release line | Affected versions | First patched release | Fix commit |
|---|---|---|---|
| 4.x | >= 4.11.0, < 4.18.2 | 4.18.2 | cc18b22202 |
| 5.0.x–5.4.x | >= 5.0.0, < 5.4.2 | 5.4.2 | a13cd8600d |
| 5.5.x | >= 5.5.0, < 5.5.2 | 5.5.2 | e0ac4aa452 |
The fix commits are included in the corresponding release tags and absent from the preceding stable releases (4.18.1, 5.4.1, 5.5.1).
Earliest verified affected stable source: 4.11.0. Token resolvers are invoked without handling malformed-body failures; the CSRF module is absent in v4.10.2.
Suggested severity
Suggested CVSS v3.1 vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N. This is an initial estimate based on the finding report and should be reviewed against the final impact and deployment prerequisites.
Source finding: ANT-2026-JLS1ZJFY.