spring-projects / spring-projects/spring-security

SEC-2816: AclPermissionEvaluator with custom ObjectIdentityGenerator doesn't work with existing BasicLookupStrategy and JdbcAclService implementations

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

Nobody has claimed this yet.

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

Description

Kenan Sevindik (Migrated from SEC-2816) said:

ObjectIdentityGenerator and ObjectIdentityRetrievalStrategy interfaces are provided to create ObjectIdentity instances and their default implementation ObjectIdentityRetrievalStrategyImpl is used by AclPermissionEvaluator during permission check. However, BasicLookupStrategy and JdbcAclService classes don't use those interfaces to create ObjectIdentity instances, instead they directly instantiate from ObjectIdentityImpl.
Hence, when we create a custom ObjectIdentityGenerator and ObjectIdentityRetrievalStrategy implementation in which we create ObjectIdentity instances from our custom ObjectIdentity implementation class and configure AclPermissionEvaluator with it, our permission checks fail because of ObjectIdentity instances created from different types, as Acl entries of a domain object are cached with ObjectIdentity as cache entry key, and they cannot be found because of different ObjectIdentity implementation classes.

IMO, it would be better to make BasicLookupStrategy and JdbcAclService classes depend on ObjectIdentityCreator and ObjectIdentityRetrievalStrategy interfaces to create ObjectIdentity instances instead of directly creating by calling new ObjectIdentityImpl(..).

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 reading BasicLookupStrategy, JdbcAclService, and AclPermissionEvaluator, focusing on how they create and retrieve ObjectIdentity instances. Trace the existing ObjectIdentityGenerator and ObjectIdentityRetrievalStrategy interfaces and their cache interactions. Done means custom ObjectIdentity implementations work consistently through permission checks, lookup, and JDBC-backed ACL service behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authorization, 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.