MODERATE 6.8

CVE-2026-47838

Spring Security Vulnerable to Unauthorized User Impersonation when Using X.509 Client Certificates

Description

In Spring Security Web, SubjectDnX509PrincipalExtractor does not correctly handle certain malformed X.509 certificate CN values, which can lead to reading the wrong value for the username. In a carefully crafted certificate, this can lead to an attacker impersonating another user.

SubjectDnX509PrincipalExtractor is deprecated by this CVE and replaced with SubjectX500PrincipalExtractor. As part of updating, you should also migrate to SubjectX500PrincipalExtractor.

Affected versions: Spring Security Enterprise 5.7.0 through 5.7.24; 5.8.0 through 5.8.26; 6.3.0 through 6.3.17; 6.4.0 through 6.4.17; 6.5.0 through 6.5.10. OSS 6.5.0 through 6.5.10.

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.springframework.security » spring-security-web
<= 5.7.14>= 5.8.0, <= 5.8.16>= 6.0.0, <= 6.3.10>= 6.4.0, <= 6.4.13>= 6.5.0, < 6.5.11
6.5.11

Blast radius

1affected artifacts
354affected versions
14,991dependent artifacts (est.)
942,391dependent versions

68% of the dependent artifacts (10,296) still pull an affected version in their latest release.

DepthDependent versions
Direct
83,555
2 hops
467,024
3 hops
262,307
4 hops
87,284
5 hops
28,481
6 hops
13,740

Most used dependents

Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.