spring-projects / spring-projects/spring-security
SEC-2816: AclPermissionEvaluator with custom ObjectIdentityGenerator doesn't work with existing BasicLookupStrategy and JdbcAclService implementations
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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