Web Development

Your Health Check Opened an Admin Route: A Framework Default Is Not an Access-Control Policy

A Spring advisory published this month opened a protected route because it shared a URL prefix with the health endpoint. The framework's allowlist and your routes are one namespace — and the allowlist is evaluated first.

KAKabir AnandLead Developer
10 min read
A corridor of identical sealed steel doors with one standing slightly ajar, light spilling onto the floor

CVE-2026-59378 was published on 20 November 2026. The mechanism is worth reading slowly, because it does not sound like a vulnerability at first. If Spring Security is on the classpath and you have not written a security configuration of your own, Spring Boot's ManagementWebSecurityAutoConfiguration registers a filter chain for you. That chain says: anyone may reach the health endpoint, everyone else must authenticate. Reasonable. Now map a Jersey resource at the same path as the health endpoint. The health matcher is built from the endpoint's path alone, with no HTTP method constraint, so every request to that shared path — GET, but also POST, PUT and DELETE — matches the permissive rule first. Your resource is served to anonymous callers. Nothing throws. Nothing logs. The application starts perfectly.

We review a lot of Spring services that arrived from somewhere else, and the pattern we keep finding is not a missing annotation. It is a team that treated the framework's default as their access-control policy, because the default is genuinely good and the login page genuinely works. That is the bug. A default is a convenience; a policy is a thing you can test, review and point at. This post is about why those are different artifacts, and what we now require before we will sign off on a service that relies on an auto-configured chain.

The allowlist runs before your rule, and it matches on path

Spring Security's authorization rules are evaluated in declaration order, and the first match wins. This is documented, well understood, and the reason every tutorial tells you to put specific rules before anyRequest(). The filter processes the matcher/rule pairs in the order they were listed and applies only the first one that matches the request.

Hold that next to the shape of the default management chain. The permissive health rule is declared first. anyRequest().authenticated() is declared last, as a catch-all. That ordering is correct for its purpose — the whole point of the separate management configuration is that health and info should be reachable without credentials. But it means the framework has written the first rule in your authorization chain, and the first rule is an allowlist keyed on a URL path.

src/main/java/com/acme/config/ManagementSecurityConfig.java
1// the shape the default registers for you when you write nothing:
2// health path -> permitAll() <-- declared first, so evaluated first
3// anyRequest() -> authenticated() <-- only reached if the above missed
4 
5@Bean
6SecurityFilterChain managementChain(HttpSecurity http) throws Exception {
7 return http
8 .securityMatcher("/internal/**") // our own prefix, not the app's
9 .authorizeHttpRequests(r -> r
10 .requestMatchers(HttpMethod.GET, "/internal/health").permitAll()
11 .anyRequest().denyAll()) // deny, not authenticate
12 .build();
13}

Two differences in that snippet are the entire argument of this post. The permissive rule is pinned to one method and one exact path rather than a matcher derived from an endpoint class, so it cannot widen when the framework's notion of "the health endpoint" changes underneath you. And the catch-all is denyAll(), because this chain's job is to serve management traffic and nothing else — if an application route ever resolves into it, the correct answer is no, not "please log in".

  • A path matcher is a prefix claim, not a route.It does not know which handler eventually serves the request, or whether that handler is yours or the framework’s. Anything that resolves under it is covered.
  • Order is policy. The same two rules in the other order produce the opposite system. Nothing in the type system records which ordering you intended.
  • Method-blind matchers widen silently. A rule written to let a monitor read health will also let a stranger write, if a writable handler lands on that path.
  • Absence is a value. When the thing a matcher refers to is not on the classpath, the matcher can resolve to nothing — and a chain with no rules is not a closed chain.

One URL namespace, two authors

ONE URL NAMESPACE, TWO AUTHORSthe framework writes the first rule; you write the catch-all it falls through toRULE 01 · DECLARED BY THE FRAMEWORK · EVALUATED FIRSTEndpointRequest.to(HealthEndpoint.class) → permitAll()matched on path alone — no HTTP method constraint/actuator/healthframework/healthzhealth group path/healthz/adminYOUR protected route/api/ordersYOUR protected routeTHE COLLISION/healthz/admin is your route, inside the framework’s match spanfirst match wins → rule 02 is never reached for it → served anonymouslyRULE 02 · YOURSanyRequest().authenticated()covers only what rule 01 missedTHREE 2026 ADVISORIES, ONE ROOT CAUSE:a path-matched allowlist your own routes can fall inside
The framework is not wrong about its own endpoints. It is just writing rules in a namespace you also write in, and its rule goes first.

Three advisories this year, one architectural mistake

What makes this worth a post rather than a patch note is that the same surface produced three different advisories in 2026, with three different trigger conditions and one shared root cause. If you read them as separate bugs you patch three times and learn nothing. If you read them as one shape, you change how you configure the service and the class of bug goes away.

AdvisoryWhat has to be true in your appWhat the default chain then doesFixed in
CVE-2026-40976 — CVSS 9.1, CWE-862, April 2026Servlet web app; no Spring Security config of its own; spring-boot-actuator-autoconfigure present; spring-boot-health absentRegisters a filter chain with no authorization rule at all — unauthorised access to every endpoint4.0.6 (affected 4.0.0–4.0.5)
CVE-2026-22731 — CVSS 8.2, CWE-288Actuator on the classpath; a custom health group declared with an additional path, such as /healthzApplies the permissive health policy to the whole /healthz prefix, including an authenticated /healthz/admin beneath it4.0.3, 3.5.11, 3.4.15
CVE-2026-59378 — high severity, 20 November 2026Spring Security on the classpath; default config relied on; a Jersey resource mapped at the health endpoint's pathMatches the health path first and permits it, for every HTTP method including POST, PUT and DELETE4.1.3

The first one is the most instructive, because the trigger is a dependency that is not there. Spring Boot 4.0 split the old monolithic auto-configuration jar into more than seventy fine-grained modules, and health support moved out of spring-boot-actuator-autoconfigure into a dedicated spring-boot-health module. An application that pulled in actuator auto-configuration without the health module ended up with a default chain whose only authorization rule referred to an endpoint that was not on the classpath. The rule resolved to nothing. A chain with no rules does not deny by default; it simply has nothing to say, and the request proceeds.

Flat vector of a four-segment horizontal track with a translucent amber band covering the first three segments and leaving the fourth uncovered
The band is the framework's match span. Everything under it is answered before your rule is consulted — including the segments you thought you owned.

Note what kind of change caused that: a refactor of the build, published as an improvement, with a migration guide. No security code was touched. A team upgrading would have read about module granularity and a new spring-boot-autoconfigure-classic compatibility module, applied the dependency changes until the application compiled and started, watched their login page still work, and shipped. The authorization posture of the service changed as a side effect of a dependency graph edit, and there was no test anywhere in the pipeline whose job was to notice.

Your routes and the framework's allowlist share one namespace

Here is the design conclusion we have landed on after cleaning up several of these. The vulnerability is not really "the default chain is too permissive". It is that management endpoints and application endpoints are being addressed in the same URL namespace, so an allowlist written for one of them can capture the other. Two parties are writing rules into a shared address space, neither can see the other's entries, and resolution is first-match-wins. That is a namespace collision, and collisions are an architecture problem, not a configuration bug.

Which is why the fix we reach for first is not a better rule. It is to stop sharing the namespace. Spring Boot has supported this for years: set management.server.port and the management endpoints get their own server context — their own port, connection pool and request-handling infrastructure, separate from the main application. A path under the application's tree can no longer resolve into a management allowlist, because they are not in the same tree any more. Pair it with management.server.address to bind that listener to localhost or a management interface, and the endpoints are off the public surface at the network layer as well as the policy layer. If you do not need them over HTTP at all, management.server.port=-1 turns the HTTP exposure off entirely.

  • Separate the port, not just the prefix. A distinct prefix on the same listener is still one namespace, and still one ordered rule list. A distinct port is two.
  • Bind the management listener narrowly. Setting management.server.address restricts access at the network level, which holds even if a future default changes the policy level.
  • Write the chain you want to be reviewed on. An explicit SecurityFilterChain bean is a file a reviewer can read and a test can assert against. An auto-configured one is a behaviour that depends on your dependency graph.
  • Make the catch-all deny. On a chain scoped to management traffic, denyAll is the honest terminal rule. Calling authenticated instead quietly promises that some credential, somewhere, ought to be enough.
  • Never let a health group’s additional path sit above application routes. If /healthz is a health group path, then nothing of yours lives beneath it. That is a naming rule you can lint.
Isometric illustration of two separate raised platforms, each with its own gatehouse, barrier and feed pipe, with empty space between them
Two listeners, two gates, no shared prefix to argue over. The gap between the platforms is doing more security work than any rule you could write across one.

“A default is a convenience. A policy is an artifact you can read, test and point at in review. These advisories are what happens when a team accepts the first and reports the second.”

We are not arguing that auto-configuration is a mistake, or that these advisories reflect carelessness by the people who wrote them. The default management chain is a sensible piece of engineering solving a real ergonomics problem, and every one of these was found, disclosed and fixed properly. The argument is narrower: auto-configuration reduces boilerplate, and it cannot own your security contract, because it does not know which of your routes matter. Only you know that, so only you can write it down.

Four questions we ask before we trust a default

These go on the review checklist for any service where authorization is auto-configured. They are deliberately answerable from the packaged artifact rather than from the source tree, because every advisory above depends on what actually ends up on the classpath.

  • 1Can you print the effective rule list? Not the intended one. Boot the packaged production artifact and enumerate the registered filter chains and their matcher/rule pairs, in order. If nobody on the team can produce that list on demand, there is no policy — there is a hope.
  • 2Does an unauthenticated probe run in CI, against the built artifact? Start the jar, hit a representative public route and a representative protected route with no credentials, and assert the status codes. Fail the build on an unexpected 200. This is the test that would have caught all three, and it is an afternoon of work.
  • 3Do you probe the module combinations you actually ship? CVE-2026-40976 triggers on a module being absent. A single happy-path integration test cannot see that; a matrix over your supported dependency combinations can. If you build a slim and a full variant, both belong in the matrix.
  • 4Is there any path prefix owned by both the framework and you?Enumerate the management paths — base path, every endpoint, every health group additional path — and diff them against your application’s route table. Any shared prefix is a finding, and the fix is a separate port rather than a better-ordered rule.

One last scheduling note, since it changes the cost of acting on this. Spring Boot 4.0 reaches end of life on 31 December 2026, and 4.1 is supported until 31 July 2027. If you are on a 4.0 line you are going to touch the dependency graph before the end of the year regardless. That upgrade is the cheapest moment you will get to add the unauthenticated-probe job and move management onto its own port — while someone is already looking at the build file, rather than six months later while reading an advisory and trying to work out whether it applies to you.

Keep Reading

More from the blog

Track Record

The Engineering Partner You Can Build On

Reliable software takes an experienced team that owns delivery end to end. Here’s the track record behind ours.

Book a Free Consultation
01

11+

Years Building Custom Software

02

320+

Projects Delivered Across Web, Mobile & AI

03

85%

Repeat Client Rate

04

12+

Countries Served Worldwide

Trusted by startups and enterprises worldwide

Work With Us

Let’s create
with purpose

Share your goals, timeline, and challenges — we’ll respond with clarity and next steps.

Ambitious ideas deserve thoughtful execution. Start the conversation and let’s define what success looks like.

Team

Acetrum

Est. 2015

4.9/5

Trusted by
top brands

Services interested in:

By submitting, I confirm I’ve read and agree with Privacy and Cookie Policies.

Newsletter

Signals worth
paying attention

No recycled headlines — just the patterns we’re seeing across real client work, distilled into one read a month.

A curated digest of practical thinking and real-world brand perspectives monthly.

No spam. Unsubscribe anytime.