Static resources with no rule are public if reject-not-found is false
Description
With micronaut.security.reject-not-found: false, micronaut-security lets an anonymous client download any static resource that no security rule covers. Under the default setting the same request gets a 401, and the manual says a request that no rule decides is rejected. The option is documented only as returning 404 instead of 401 for routes that do not exist. The attacker needs nothing beyond network access and the path of a file under a micronaut.router.static-resources mapping. They can read the file but not modify it, and GET, HEAD, POST and DELETE all return it. The attached reproducer runs the same app twice: an anonymous GET /exports/customers.csv gets 401 with the default setting...
Affected and patched versions
The following ranges cover stable releases.
| Release line | Affected versions | First patched release | Fix commit |
|---|---|---|---|
| 3.11.x and earlier | >= 1.4.0, < 3.11.4 | 3.11.4 | 9eb3189e5e |
| 4.x | >= 4.0.0, < 4.18.3 | 4.18.3 | b381191b0e |
| 5.0.x–5.4.x | >= 5.0.0, < 5.4.3 | 5.4.3 | 0fcde4099b |
| 5.5.x | >= 5.5.0, < 5.5.3 | 5.5.3 | 46489c44d8 |
The fix commits are included in the corresponding release tags and absent from the preceding stable releases (3.11.3, 4.18.2, 5.4.2, 5.5.2).
Earliest affected stable source: 1.4.0. SecurityFilter proceeds when no route matches and reject-not-found is false; the option is absent in v1.3.2. The original finding estimated 4.0.0 as the lower bound.
Suggested severity
Suggested CVSS v3.1 vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/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-NIXUUB0R.