1
0
mirror of synced 2026-08-23 02:27:44 +00:00
Commit Graph

3349 Commits

Author SHA1 Message Date
Josh Cummings 19afc9121e Merge branch '7.1.x'
Closes gh-19568
# Conflicts:
#	gradle/libs.versions.toml
2026-08-20 12:29:12 -06:00
Josh Cummings 057581584a Align Null Behavior
Previously, ExternalInetAddressMatcher treated a null InetAddress
as external by negating InternalInetAddressMatcher's result.

This commit makes ExternalInetAddressMatcher return false for a
null address, so that neither the internal nor the external
matcher classifies an unknown address as a match.

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-08-20 11:21:20 -06:00
Josh Cummings 01452e328f Use Constant-Time Equals
This commit updates the filter to use constant-time
equals for sensitive material

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-08-20 11:21:05 -06:00
Josh Cummings 15a31d7dd7 Check isAnyLocalAddress
This commit updates InternalInetAddressMatcher to check
InetAddress#isAnyLocalAddress in order to catch
additional IP addresses

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-08-20 11:20:58 -06:00
Josh Cummings c9220ca39e Align Null Behavior
Previously, ExternalInetAddressMatcher treated a null InetAddress
as external by negating InternalInetAddressMatcher's result.

This commit makes ExternalInetAddressMatcher return false for a
null address, so that neither the internal nor the external
matcher classifies an unknown address as a match.

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-08-20 10:38:09 -06:00
Josh Cummings 627a412748 Use Constant-Time Equals
This commit updates the filter to use constant-time
equals for sensitive material

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-08-20 10:38:07 -06:00
Josh Cummings 1fa37a9479 Merge branch '7.1.x' 2026-08-19 16:55:49 -06:00
Josh Cummings 4e92ea215c Merge branch '7.0.x' into 7.1.x 2026-08-19 16:55:38 -06:00
Tadaya Tsuyukubo d111029078 Prevent sharing SecurityContext across threads
`SecurityContextHolderThreadLocalAccessor` currently propagates the
same `SecurityContext` to other threads when Micrometer
Context Propagation is used. This leads to unintended sharing of
mutable state and can cause authentication to leak between threads.

This change updates the accessor to create a new
`SecurityContext` for the target thread while reusing only the
`Authentication` value. Each thread now receives its own
`SecurityContext` instance, preventing cross-thread interference and
aligning with recommended `SecurityContext` usage.

Signed-off-by: Tadaya Tsuyukubo <tadaya@ttddyy.net>
2026-08-19 16:54:43 -06:00
Josh Cummings 82241b6cb8 Merge branch '7.1.x'
Closes gh-19549
2026-08-13 15:59:03 -06:00
Josh Cummings 7cecfbb4db Merge branch '7.0.x' into 7.1.x
Closes gh-19548
2026-08-13 15:58:42 -06:00
dae won 5b923c78ea Validate Parameter in setPostAuthenticationChecks
The null check in setPostAuthenticationChecks of
AbstractUserDetailsReactiveAuthenticationManager asserted the current
field value, which is initialized to a default and can never be null,
instead of the method parameter. As a result, null was silently
accepted and the next authenticate call failed with a raw
NullPointerException instead of failing fast with a clear message.

Closes gh-19276

Signed-off-by: dae won <eodnjs01477@gmail.com>
2026-08-13 15:58:01 -06:00
Josh Cummings 94d36e603b Merge branch '7.1.x'
Closes gh-19540
2026-08-13 11:37:03 -06:00
Josh Cummings ade851b2f1 Merge branch '7.0.x' into 7.1.x
Closes gh-19539
2026-08-13 11:36:49 -06:00
junhyeong9812 9fdd2dc675 Lowercase username in changePassword lookup
InMemoryUserDetailsManager keys its user map on the lower-cased
username everywhere except changePassword, which looked the current
user up with the raw name. A user whose username contains uppercase
letters could therefore not change its password. Lower-case the
lookup key to match the rest of the class.

Closes gh-19336

Signed-off-by: junhyeong9812 <pickjog@gmail.com>
2026-08-13 11:35:59 -06:00
Josh Cummings 09a3280442 Merge branch '7.1.x' 2026-08-11 19:41:02 -06:00
Josh Cummings 852e81640b Merge branch '7.0.x' into 7.1.x 2026-08-11 19:40:43 -06:00
Josh Cummings 2aa3c1ab2e Remove NullAway
Issue gh-17816

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-08-11 19:40:18 -06:00
Kim Tae Eun 17c58ef088 Remove BeanResolver Null Checks
StandardEvaluationContext.setBeanResolver now accepts a nullable
BeanResolver, so the workarounds added for the original limitation
are no longer needed. This removes the explicit null guards (and
equivalent Optional.ofNullable idiom) as well as the
@SuppressWarnings("NullAway") annotations introduced to silence
the false positives.

In addition to the seven sites that explicitly referenced
spring-projects/spring-framework#35371, two sites in
spring-security-core followed the same workaround pattern without
the comment marker (AbstractSecurityExpressionHandler and
DefaultMethodSecurityExpressionHandler) and have also been
simplified.

Closes gh-17816

Signed-off-by: Kim Tae Eun <snowykte0426@naver.com>
2026-08-11 18:37:09 -07:00
Josh Cummings c096e45242 Support Account Status Checks in OneTimeTokenReactiveAuthenticationManager
Add the same opt-in UserDetailsChecker support to
OneTimeTokenReactiveAuthenticationManager, mirroring
OneTimeTokenAuthenticationProvider for the reactive stack.

Issue gh-17655

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-08-11 15:18:49 -07:00
Josh Cummings b3e262187c Make OneTimeTokenAuthenticationProvider Account Status Checks Opt-In
OneTimeTokenAuthenticationProvider no longer validates account status
by default. Applications can opt in via setUserDetailsChecker, for
example by providing AccountStatusUserDetailsChecker to reject locked,
disabled, or expired accounts.

Issue gh-17655

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-08-11 15:18:49 -07:00
Andrey Litvitski 64fa98da1a Validate account status in OneTimeTokenAuthenticationProvider
The main problem is that OneTimeTokenAuthenticationProvider does not
extend from AbstractUserDetailsAuthenticationProvider, which has a
preauthentication check for user details. However, we do not need to
extend from it because it does not fit the context of the class. In this
regard, I decided to add my own checker to this commit, which performs a
preauthentication check before authorizing the account, similar to how
it is done in AbstractUserDetailsAuthenticationProvider. I also added a
test to OneTimeTokenAuthenticationProviderTests that identifies this
problem.

Closes gh-17655

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-08-11 15:18:49 -07:00
Josh Cummings b62affe126 Correct Copyright Headers
This commit updates all headers to have
the same date range.

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-07-08 17:11:04 -06:00
Josh Cummings 40b074580c Merge branch '7.0.x' into main 2026-04-20 10:21:19 -06:00
Joe Grandja 3ef1c34632 Merge branch '6.5.x' into 7.0.x 2026-04-18 12:47:05 -04:00
Seol-JY 4187af38b2 Verify token deletion in JdbcOneTimeTokenService 2026-04-18 12:30:30 -04:00
Josh Cummings 4a6e0a13cd Update DaoAuthenticationProvider Usage
Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-04-15 21:14:23 -06:00
Josh Cummings fc630ae6eb Merge branch '6.5.x' into 7.0.x 2026-04-15 21:07:50 -06:00
Josh Cummings a317a3d866 Add Support for Always Running Additional Authentication Checks
Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-04-15 21:07:39 -06:00
Josh Cummings cb129d6b2d Merge branch '7.0.x' 2026-03-31 15:56:49 -06:00
Josh Cummings d4678c8e04 Add Missing Serialization Support
Closes gh-19013

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-03-31 15:55:09 -06:00
Josh Cummings 08fca57d12 Add Missing Serialization Support
Closed gh-19012

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-03-31 13:58:35 -06:00
Robert Winch ff820a868e Polish AllRequiredFactorsAuthorizationManager.anyOf
- Add validation
- Extract to static inner class
- Uniqueness determined by Set rather than requiredFactor
  This is important for the failure with the same RequiredFactor, but a
  different reason
- Add documentation

Signed-off-by: Robert Winch <362503+rwinch@users.noreply.github.com>
2026-03-31 14:03:29 -05:00
Evgeniy Cheban 6b09352a93 Add AllRequiredFactorsAuthorizationManager.anyOf
Closes gh-18960

Signed-off-by: Evgeniy Cheban <mister.cheban@gmail.com>
2026-03-31 13:25:02 -05:00
Robert Winch 51ce11cbd2 Move InetAddressMatcher to spring-security-core
Closes gh-18979
2026-03-25 15:25:57 -05:00
Andrey Litvitski 2fda37de53 Fix equals nullability annotations for jspecify compliance
In this commit, we added `@Nullable` to equals methods of classes that
support `jspecify` for consistency with other Spring projects and to
avoid bugs that caused other Spring projects to do this natively.

Closes: gh-18929, gh-18927

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-03-23 09:25:57 -06:00
Bae Jihong e9f331c30c Add test code for setAuthorizationManagerFactory
- add test for setAuthorizationManagerFactory that is a alternative to setTrustResolver and setDefaultRolePrefix

Closes gh-18412

Signed-off-by: Bae Jihong <dasog@naver.com>
2026-03-20 20:16:54 -06:00
Robert Winch 28acf62936 AuthorizationManagerFactories.when
Closes gh-18920
2026-03-17 17:20:58 -05:00
Robert Winch 8224b16caf Add ConditionalAuthorizationManager
Closes gh-18919
2026-03-17 17:20:57 -05:00
Josh Cummings 94829a1551 Merge remote-tracking branch 'origin/7.0.x' 2026-03-03 18:18:24 -07:00
Andrey Litvitski 4f97217f68 Refine upgradeEncoding condition in DaoAuthenticationProvider
After adding jspecify support in the module that contains the
DaoAuthenticationProvider class, we actually changed the contract logic,
which is a good thing, and this commit fixes it.

Closes: gh-18781

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-03-03 18:18:13 -07:00
Josh Cummings 0c42016781 Merge branch '7.0.x' 2026-02-26 17:11:06 -07:00
Josh Cummings 1575610d49 Add Tests
Issue gh-18486

Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com>
2026-02-26 17:10:55 -07:00
Michael Lück 3a14745d92 Delegate calls of hasAuthority to AuthorizationManager#hasAuthority
Closes gh-18486

Signed-off-by: Michael Lück <michael@lueckonline.net>
2026-02-26 17:10:55 -07:00
Andrey Litvitski 6d4726bfb7 Mark targetDomainObject as @Nullable in PermissionEvaluator
Closes: gh-18259

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-02-24 10:55:06 -06:00
Robert Winch ac06067d02 Revert "Mark targetDomainObject as @Nullable in PermissionEvaluator"
This reverts commit 9f1381c382.
2026-02-24 09:40:54 -06:00
Andrey Litvitski 9f1381c382 Mark targetDomainObject as @Nullable in PermissionEvaluator
Closes: gh-18259

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
2026-02-24 08:27:44 -06:00
Robert Winch cfb3bf38d8 Merge Fix: Handle null authority string in AuthoritiesAuthorizationManager into main 2026-02-23 10:54:00 -06:00
Robert Winch 151bcf3b0b Merge Fix: Handle null authority string in AuthoritiesAuthorizationManager into 7.0.x 2026-02-23 10:53:40 -06:00
Robert Winch 1116241ee3 Fix Checks for NullPointerException in AuthoritiesAuthorizationManager
- Fix checkstyle
- Fix the test to use Collection that throws NullPointerException on .contains(null) to replicate the reported issue

Closes gh-18544

Signed-off-by: Robert Winch <362503+rwinch@users.noreply.github.com>
2026-02-23 10:47:11 -06:00