Skip to content
Misconfiguration Write-up Intermediate

Update the Security of your Spring Project Right Now !

Spring Security's OnCommittedResponseWrapper fails to override header methods, so when Content-Length is set early by caching layers, proxies or load balancers, the response commits before security headers are injected, silently dropping them. Spring Actuator's EndpointRequest matcher generates overly broad Ant patterns when a custom health group maps to an additional path, allowing unauthenticated access to protected sub-paths and admin endpoints.

medium.com

Published on medium.com

While I was on twitter (or X) I came across a tweet that caught my attention by the @springcentral account the official Spring account. However as of today this post has only 43 likes and around 4k views which is mind blowing because this post is really important especially nowadays where we wake up to new hacks…

Dev Genj, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the wrapper class does not override header methods, so headers set after the response is committed are lost; and the endpoint matcher builds patterns that are too broad, so protected paths inherit public rules.

Impact

The missing headers could open doors to XSS, CSRF and session hijacking, and the Actuator flaw allows unauthenticated remote access to admin endpoints, configuration dumps and database credentials with no special payload and no user interaction.

What the attacker needed

Spring Security 5.7.x to 7.0.3; Content-Length set early by a proxy or cache; Spring Actuator enabled; Custom health group mapped to extra path

The fix

Upgrade to the minimum safe versions: Spring Security 6.5.9 or 7.0.4, and Spring Boot 3.4.15, 3.5.12 or 4.0.4.

How it was found

  1. Set Content-Length early via a caching layer, proxy or load balancer.
  2. The response commits before Spring can inject security headers.
  3. Security headers are silently dropped from the response.
  4. For Actuator, map a custom health group to an additional path such as /healthz.
  5. The EndpointRequest matcher generates overly broad Ant patterns.
  6. Send a GET request to a protected sub-path to gain unauthenticated access.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Spring is a popular Java framework. Security headers are instructions a server sends to the browser to block attacks like cross-site scripting. In the first bug, those headers were silently left out of responses, so the browser had no protection. In the second, a misconfigured access rule let anyone reach admin pages without logging in.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.