Wednesday, May 7, 2025
HomeCVE/vulnerabilitySpring Security Vulnerability Exposes Valid Usernames to Attackers

Spring Security Vulnerability Exposes Valid Usernames to Attackers

Published on

SIEM as a Service

Follow Us on Google News

A newly identified security vulnerability, CVE-2025-22234, has exposed a critical weakness in the widely-used Spring Security framework.

According to the HeroDevs report, affecting several versions of the spring-security-crypto package, this flaw makes it possible for attackers to discern valid usernames through observable differences in login response times—an avenue for so-called “timing attacks.”

Spring Security is a cornerstone Java framework for most enterprise applications, enabling authentication, authorization, and various other security measures.

- Advertisement - Google News

It integrates tightly with the Spring ecosystem and is valued for its flexibility and robust configuration options.

However, this latest vulnerability undermines those very protections, highlighting the delicate balance between performance and security.

CVE-2025-22234: Details of the Vulnerability

The core issue arises from a recent patch (CVE-2025-22228) designed to address a different bug in the spring-security-crypto package.

Unfortunately, this update inadvertently weakened existing mitigations against timing attacks in the DaoAuthenticationProvider.

Specifically, when using the BCrypt password encoder, requests with passwords longer than 72 characters would cause the encoder to throw an exception.

This difference in system behavior makes it possible for attackers to measure how long the authentication process takes and infer whether a username exists in the system.

CVEProductAffected VersionsFixed InPatch Status
CVE-2025-22234Spring Security5.7.16, 5.8.18, 6.0.16, 6.1.14, 6.2.10, 6.3.8, 6.4.4NES v5.7.18, v5.8.21Patch Available

Previously, Spring Security always performed a password check, regardless of the username’s validity.

This strategy ensured that login response times were consistent, thus preventing attackers from distinguishing between valid and invalid usernames.

The new behavior, however, creates an observable disparity, increasing the risk of information exposure.

Technical Impact

  • Who is affected: All users of Spring Security versions 5.7.16, 5.8.18, 6.0.16, 6.1.14, 6.2.10, 6.3.8, and 6.4.4 using DaoAuthenticationProvider with BCryptPasswordEncoder.
  • Attack scenario: An attacker submits login attempts with various usernames and measures response times. A faster response indicates an invalid username, while a slower one signals a valid username (even if the password is wrong), thus facilitating username enumeration.
  • Remediation: The vulnerability has been fixed in the Never-Ending Support (NES) releases v5.7.18 and v5.8.21. Users are strongly advised to update immediately.

Upgrading to the latest patched version of Spring Security is the best line of defense. Developers should test systems to ensure consistent response times irrespective of username validity and password length.

Find this News Interesting! Follow us on Google NewsLinkedIn, & X to Get Instant Updates!

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Latest articles

BFDOOR Malware Targets Organizations to Establish Long-Term Persistence

The BPFDoor malware has emerged as a significant threat targeting domestic and international organizations,...

Uncovering the Security Risks of Data Exposure in AI-Powered Tools like Snowflake’s CORTEX

As artificial intelligence continues to reshape the technological landscape, tools like Snowflake’s CORTEX Search...

UNC3944 Hackers Shift from SIM Swapping to Ransomware and Data Extortion

UNC3944, a financially-motivated threat actor also linked to the group known as Scattered Spider,...

Over 2,800 Hacked Websites Targeting MacOS Users with AMOS Stealer Malware

Cybersecurity researcher has uncovered a massive malware campaign targeting MacOS users through approximately 2,800...

Resilience at Scale

Why Application Security is Non-Negotiable

The resilience of your digital infrastructure directly impacts your ability to scale. And yet, application security remains a critical weak link for most organizations.

Application Security is no longer just a defensive play—it’s the cornerstone of cyber resilience and sustainable growth. In this webinar, Karthik Krishnamoorthy (CTO of Indusface) and Phani Deepak Akella (VP of Marketing – Indusface), will share how AI-powered application security can help organizations build resilience by

Discussion points


Protecting at internet scale using AI and behavioral-based DDoS & bot mitigation.
Autonomously discovering external assets and remediating vulnerabilities within 72 hours, enabling secure, confident scaling.
Ensuring 100% application availability through platforms architected for failure resilience.
Eliminating silos with real-time correlation between attack surface and active threats for rapid, accurate mitigation

More like this

BFDOOR Malware Targets Organizations to Establish Long-Term Persistence

The BPFDoor malware has emerged as a significant threat targeting domestic and international organizations,...

Uncovering the Security Risks of Data Exposure in AI-Powered Tools like Snowflake’s CORTEX

As artificial intelligence continues to reshape the technological landscape, tools like Snowflake’s CORTEX Search...

UNC3944 Hackers Shift from SIM Swapping to Ransomware and Data Extortion

UNC3944, a financially-motivated threat actor also linked to the group known as Scattered Spider,...