CVE-2026-59400

Information Exposure
Affects
Spring Security
in
Spring
No items found.
Versions
<=5.7.26, >=5.8.0 <=5.8.28, >=6.4.0 <=6.4.19, >=6.5.0 <=6.5.12, >=7.0.0 <=7.0.8, >=7.1.0 <=7.1.2

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Spring Security is a highly customizable authentication and access-control framework for Java applications, and its OAuth2 Client support lets applications sign in users and call protected resources through OAuth 2.0 and OpenID Connect providers.

An information exposure vulnerability (CVE-2026-59400) has been identified in the ClientRegistration class of Spring Security's OAuth2 Client module, which allows attackers who can read application logs, error messages or other diagnostic output to obtain the confidential OAuth2 client secret. With the secret, an attacker can authenticate to the authorization server as the application's registered client.

Per OWASP: Access control enforces policy such that users cannot act outside of their intended permissions. Failures typically lead to unauthorized information disclosure, modification, or destruction of all data or performing a business function outside the user's limits.

This issue affects multiple versions of Spring Security.

Details

Module Info

Vulnerability Info

This Medium-severity vulnerability is found in the org.springframework.security:spring-security-oauth2-client package in multiple versions of Spring Security.

ClientRegistration is Spring Security's representation of an OAuth2 or OpenID Connect client registration. It holds the client ID, the client secret, the client authentication method, the authorization grant type, the redirect URI, the scopes and the provider details. Its toString() method writes the client secret into its output in plain text:

@Override
public String toString() {
        // @formatter:off
        return "ClientRegistration{"
                        + "registrationId='" + this.registrationId + '\''
                        + ", clientId='" + this.clientId + '\''
                        + ", clientSecret='" + this.clientSecret + '\''
                        + ", clientAuthenticationMethod=" + this.clientAuthenticationMethod
                        + ", authorizationGrantType=" + this.authorizationGrantType
                        + ", redirectUri='" + this.redirectUri
                        + '\'' + ", scopes=" + this.scopes
                        + ", providerDetails=" + this.providerDetails
                        + ", clientName='" + this.clientName + '\''
                        + ", clientSettings='" + this.clientSettings + '\''
                        + '}';
        // @formatter:on
}

Java calls toString() implicitly in many common situations: parameterized logging such as log.debug("Using {}", registration), string concatenation, exception message construction, and debugging or monitoring tools that render objects. Any of these code paths, in the application or in a library it uses, sends the client secret to a destination that was never meant to hold client credentials, such as log files, log aggregation services or error reports. The vulnerability is rated CVSS 3.1 6.5 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N): an attacker with low-privileged access to such output can read the secret and use it to impersonate the client at the authorization server.

Steps to Reproduce

  1. Add org.springframework.security:spring-security-oauth2-client at an affected version to a Java project.
  2. Build a ClientRegistration with a client secret and print it:
ClientRegistration registration = ClientRegistration.withRegistrationId("demo")
                .clientId("demo-client")
                .clientSecret("client-secret-value")
                .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_BASIC)
                .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
                .redirectUri("{baseUrl}/login/oauth2/code/{registrationId}")
                .authorizationUri("https://provider.example.com/oauth2/authorize")
                .tokenUri("https://provider.example.com/oauth2/token")
                .build();
System.out.println(registration);
  1. Observe that the output contains clientSecret='client-secret-value'.

Mitigation

Only recent versions of Spring Security receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.

Users of the affected components should apply one of the following mitigations:

  • Upgrade to a currently supported version of Spring Security.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.

Credits

Yu Bao from PayPal Cybersecurity Team (finder)

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Medium
ID
CVE-2026-59400
PROJECT Affected
Spring Security
Versions Affected
<=5.7.26, >=5.8.0 <=5.8.28, >=6.4.0 <=6.4.19, >=6.5.0 <=6.5.12, >=7.0.0 <=7.0.8, >=7.1.0 <=7.1.2
NES Versions Affected
Published date
November 20, 2026
≈ Fix date
Category
Information Exposure
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Spring
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.