1
0
mirror of synced 2026-08-23 10:37:39 +00:00

3339 Commits

Author SHA1 Message Date
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 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 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 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 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 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
Khyojae d87dc9ae57 Fix: Handle null authority string in AuthoritiesAuthorizationManager
This prevents NPE when GrantedAuthority.getAuthority() returns null. Closes gh-18543

Signed-off-by: Khyojae <khjae201@gmail.com>
2026-02-23 09:30:28 -06:00
Robert Winch 21978cab22 Fix Build Errors for Improve AOT RuntimeHits
- Saml2RuntimeHints consistently uses String in separate method for
  to ensure no classpath issues
- Fix Whitespace/Checkstyle
- Add Missing Nullability Annotations
2026-02-20 17:28:35 -06:00
Josh Long 2dd2863550 aot improvements
Signed-off-by: Josh Long <54473+joshlong@users.noreply.github.com>
2026-02-20 17:28:35 -06:00
Minu Kim 18068c9099 fix compile warning in spring-security-test
Signed-off-by: Minu Kim <kmw106933@naver.com>
2026-02-19 14:26:20 -06:00
Tran Ngoc Nhan dbf7f4cfe5 Remove unused @Nullable
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-19 10:56:54 -06:00
earlgrey02 5194826606 implement single-line RSA key support
Signed-off-by: earlgrey02 <san06036@naver.com>
2026-02-17 17:29:04 -07:00
Tran Ngoc Nhan da0cd0bc68 Remove unused import
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan 17933ddab3 Resolve feedback
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan 9323775c5f Update javadoc and apply StringUtils#hasLength
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00
Tran Ngoc Nhan 4cc5f543ab Add author
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-17 16:59:55 -07:00