CVE-2026-22747
Java vulnerability analysis and mitigation

Overview

CVE-2026-22747 is an unauthorized user impersonation vulnerability in Spring Security affecting the SubjectX500PrincipalExtractor component. The extractor does not correctly handle certain malformed X.509 certificate CN (Common Name) values, causing it to read the wrong username and potentially allowing an attacker to impersonate another user. It affects Spring Security versions 7.0.0 through 7.0.4 (Maven package org.springframework.security:spring-security-web), and was disclosed on April 22, 2026. The CVSS v3.1 base score is 6.8 (Moderate) per GitHub Advisory, or 8.1 per NVD, reflecting a network-exploitable authentication bypass with high confidentiality and integrity impact (Spring Advisory, GitHub Advisory).

Technical details

The root cause is classified as CWE-297 (Improper Validation of Certificate with Host Mismatch): SubjectX500PrincipalExtractor fails to correctly parse certain malformed X.509 certificate CN values, causing it to extract the wrong username from the certificate subject. An attacker with a low-privileged account can craft a specially malformed certificate such that the extractor reads a different user's identity, enabling impersonation. Importantly, Spring's advisory notes this component sits behind the pre-authentication flow, which assumes upstream trust validation has already occurred — exploitation therefore presupposes some compromise or bypass of that upstream trust, making this more of a defense-in-depth fix than a standalone critical attack path. The fix applies only to SubjectX500PrincipalExtractor and not the deprecated SubjectDnX509PrincipalExtractor (Spring Advisory, GitHub Advisory).

Impact

Successful exploitation allows an authenticated low-privileged attacker to impersonate another user within the application, gaining unauthorized access to that user's resources and permissions. This results in high confidentiality impact (access to another user's data) and high integrity impact (ability to perform actions as another user), with no availability impact. The scope is limited to the affected application instance, but lateral movement within the application's authorization model is possible depending on the impersonated user's privilege level (Spring Advisory, GitHub Advisory).

Exploitability

There is no confirmed in-the-wild exploitation of CVE-2026-22747 as of the time of reporting. A GitHub repository (https://github.com/F1n1Sh3r/cve-2026-22747-lab) was identified as a potential PoC, but Feedly's analysis assessed it as a placeholder or non-functional repository with no meaningful exploit content. The EPSS score is approximately 0.031% (9th percentile), indicating a low probability of exploitation in the near term. The vulnerability is not listed in the CISA KEV catalog, and no threat actor attribution has been reported (GitHub Advisory, Feedly).

Exploitation steps

  1. Identify target: Locate a Spring Security application (versions 7.0.0–7.0.4) that uses X.509 client certificate authentication with SubjectX500PrincipalExtractor for username extraction.
  2. Obtain a low-privileged certificate: Acquire or generate a valid client certificate that is accepted by the application's upstream trust validation (e.g., signed by a trusted CA).
  3. Craft malformed CN value: Modify the certificate's Subject CN field with a specially crafted malformed value designed to cause SubjectX500PrincipalExtractor to parse and return a different user's username (e.g., by exploiting ambiguous DN parsing or special character handling).
  4. Present the certificate: Submit the crafted certificate to the application's X.509 authentication endpoint.
  5. Achieve impersonation: If successful, the application reads the wrong username from the CN, authenticating the attacker as the target user and granting access to that user's resources and permissions (Spring Advisory, GitHub Advisory).

Indicators of compromise

  • Logs: Authentication log entries showing a user authenticated via X.509 certificate where the certificate subject DN does not match the authenticated username; unexpected successful logins for high-privileged accounts from certificates belonging to low-privileged users.
  • Network: Unusual or malformed TLS client certificate handshakes with non-standard CN field values (e.g., containing special characters, embedded commas, or escape sequences in the Subject DN).
  • Application Behavior: Access to resources or API endpoints by a user account inconsistent with that account's normal activity pattern, particularly following X.509 certificate authentication events.

Mitigation and workarounds

The primary remediation is to upgrade Spring Security to version 7.0.5 or later, which contains the fix for SubjectX500PrincipalExtractor (Spring Advisory, GitHub Advisory). As a workaround if immediate patching is not possible, restrict X.509 certificate-based authentication to certificates from tightly controlled, trusted certificate authorities, and implement additional server-side validation of certificate CN values to reject malformed inputs. Organizations should also review certificate issuance policies to prevent malformed CN values from being signed by trusted CAs. Note that the deprecated SubjectDnX509PrincipalExtractor is not addressed by this fix and should be avoided.

Community reactions

HeroDevs published a blog post covering this CVE as part of a broader analysis of Spring Security's April 2026 security advisories, which included seven CVEs (HeroDevs Blog). The Spring team's advisory notably framed the fix as "defense-in-depth" rather than a standalone critical patch, given the pre-authentication trust dependency, which tempered community concern. General community sentiment appears measured, consistent with the moderate severity rating and low EPSS score.

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-73644CRITICAL9.6
  • Java logoJava
  • org.openidentityplatform.opendj:opendj-server-legacy
NoYesAug 13, 2026
CVE-2026-73507HIGH7.5
  • Java logoJava
  • seata
NoYesAug 13, 2026
CVE-2026-49989HIGH7.1
  • Java logoJava
  • io.crate:crate
NoYesAug 14, 2026
CVE-2026-53660HIGH7
  • Java logoJava
  • org.openidentityplatform.openam:openam-core
NoYesAug 14, 2026
CVE-2026-73508MEDIUM5.3
  • Java logoJava
  • celeborn-0.6
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management