spring-projects / spring-projects/spring-ldap

SSHA encoded password verification fails with Apache Directory Server

Open
#458 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
375
Forks
501
Avg merge
6h 4m
Merged PRs (30d)
63

Description

I'm in the process of learning various new Spring components and to that effect, I was doing the Spring LDAP guide here: https://spring.io/guides/gs/authenticating-ldap/ .

To make it more interesting, I wanted to talk to Apache Directory Server (which I installed from the zip distribution of ApacheDS 2.0.0-M23).

I succeeded eventually, but I think I may have uncovered a bug in the verification of Salted SHA (SSHA) encoded userPasswords, which I think happens here:

org.springframework.security.authentication.encoding.LdapShaPasswordEncoder

I've shared my project here: https://github.com/rubin55/spring-foo

To reproduce:

1: Set up ApacheDS, installed from the zip distribution and turn it on
2: Install Apache Directory Studio, connect, and load the two ldifs from my github page
3: git clone git@github.com:rubin55/spring-foo.git
4: mvn spring-boot:run the above mentioned github project
5: goto http://localhost:8080/
6: try to login with user freek (password: otherpassword): Fails because SSHA encoded
7: try to login with user rubin (password: somepassword): Succeeds, password = SHA encoded

Note: I've added a logback.xml setup so spring security and spring ldap are a bit more verbose about what's going on. All I've been able to gather though, is that LdapShaPasswordEncoder
fails to verify the password when it is presented with the SSHA hashed version.

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 reproducing the failure with the linked spring-foo project and Apache Directory Server, then inspect org.springframework.security.authentication.encoding.LdapShaPasswordEncoder. Compare the successful SHA login with the failing SSHA login; done means SSHA passwords verify while the existing SHA case continues to work.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.