Intercept URL map root pattern bypassed when a context path is set
Description
When micronaut.server.context-path is set, an intercept URL map entry for / (or /*) stops matching anything. A client without credentials, or without the required role, can then get the application's root route with a plain GET /ctx or GET /ctx/. The preconditions are all ordinary configuration: a context path is set, the root controller relies on the intercept URL map rather than @Secured, and a later, broader entry grants weaker access (for example /** → isAnonymous()). Exactly one route is exposed, the context root, for any HTTP method. The attached reproducer runs the same map with and without context-path: /portal. Anonymous GET / returns 401 at the server root and /portal/invoices...
Affected and patched versions
The following ranges cover stable releases.
| Release line | Affected versions | First patched release | Fix commit |
|---|---|---|---|
| 3.11.x and earlier | >= 3.7.2, < 3.11.3 | 3.11.3 | d80b3952f6 |
| 4.x | >= 4.0.0, < 4.18.2 | 4.18.2 | f82cfa2ef0 |
| 5.0.x–5.4.x | >= 5.0.0, < 5.4.2 | 5.4.2 | 1df3d691ba |
| 5.5.x | >= 5.5.0, < 5.5.2 | 5.5.2 | b0fbfd1614 |
The fix commits are included in the corresponding release tags and absent from the preceding stable releases (3.11.2, 4.18.1, 5.4.1, 5.5.1).
Earliest verified affected stable source: 3.7.2. v3.7.2 introduces context-path prepending of intercept URL patterns; the option is absent in v3.7.1.
Suggested severity
Suggested CVSS v3.1 vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/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-B3PSVAUU.