spring-projects / spring-projects/spring-security

SEC-2814: ldapAuthentication always successful with false UserDetails attributes

Open
#3,034 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: config in: ldap type: bug type: jira
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

vialleton (Migrated from SEC-2814) said:

Implementing a ldapAuthentication into my Spring Security configuration makes the process ignoring the boolean field : "enabled" on Users (org.springframework.security.core.userdetails) so it's allowing disabled Users to connect..

The Security Config works well and it disallow disabled Users to connect with a simple authentication using userDetailsService but it fails with ldapAuthentication.

And implementing a custom userDetailsContextMapper doesn't work too.

Is this a normal behavior ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the ldapAuthentication entry point and the UserDetails, userDetailsService, and custom userDetailsContextMapper paths described in the report. Reproduce the case with a disabled user and compare it with simple userDetailsService authentication; done means ldapAuthentication rejects users whose enabled attribute is false.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authentication, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.