Commit Graph
35282 Commits
Author SHA1 Message Date
Sam Brannen 7c2fdcc1fb Merge branch '7.0.x' 2026-07-30 16:25:12 +03:00
Sam Brannen 0f5bd82c5d Centralize SpEL security documentation in the reference manual
The Javadoc for EvaluationContext, StandardEvaluationContext, and
SimpleEvaluationContext previously repeated the same detailed
explanation of trusted sources and best-effort restrictions in four
places, making it hard to maintain and to digest.

This commit condenses each class-level warning to a succinct summary
that links to the new "Security Considerations" section of the SpEL
reference documentation, which remains the single, detailed source of
truth introduced in 9b42a40a2a.

See gh-36997
2026-07-30 16:23:44 +03:00
Sam Brannen abe33703b4 Update Javadoc for PropertyDescriptorUtils.determineBasicProperties()
See gh-37081
2026-07-30 15:16:19 +03:00
Arnab Nandy badddeb0dc Ignore static get/is accessor methods in PropertyDescriptorUtils
Prior to this commit, PropertyDescriptorUtils.determineBasicProperties()
incorrectly recognized static `get` and `is` accessor methods as
JavaBean read methods, in contrast to the standard
java.beans.Introspector, which has always excluded static methods from
property discovery. This regression was introduced in Spring Framework
6.0 when determineBasicProperties() replaced the delegation to
java.beans.Introspector for the fast property-discovery path used by
SimpleBeanInfoFactory. As a result, an unrelated static method such as
a singleton accessor could be exposed as a bean property, and
reflective access to such a property (for example, via BeanWrapperImpl)
could lead to a StackOverflowError if the property's value recursively
exposed the same static accessor.

To address that, this commit adds Modifier.isStatic(...) checks to the
`get` and `is` branches in determineBasicProperties(), mirroring the
equivalent check already present in
CachedIntrospectionResults.isPlainAccessor(). Static `set` methods
continue to be supported as write methods, consistent with the existing
behavior in ExtendedBeanInfo.

See gh-37068
Closes gh-37081

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
2026-07-30 14:12:08 +02:00
rstoyanchev 50f923ace4 Restore MatchableHandlerMapping
See gh-36481
2026-07-30 12:07:17 +03:00
Sam Brannen 317eae88d0 Merge branch '7.0.x' 2026-07-29 22:07:54 +03:00
Sam Brannen a894818c9e Document lifecycle and reuse contract for SpEL expressions and contexts
This commit adds a "Lifecycle and Reuse" section to the SpEL reference
documentation, immediately following the security considerations
introduced for gh-36997, explaining that AST nodes within a parsed
Expression may cache resolved PropertyAccessor, IndexAccessor,
MethodExecutor, and ConstructorExecutor instances for performance.

We also now document that reusing a parsed Expression across
EvaluationContext instances of the same type and with equivalent
configuration is supported (even if atypical), including when accessors
or resolvers registered with a context change between evaluations, but
that reusing a parsed Expression across contexts with different
security implications (for example, first against a
StandardEvaluationContext and later against a SimpleEvaluationContext)
is not supported, since cached state from a more permissive evaluation
may be reused during a more restrictive one.

The Javadoc for Expression, SpelExpression, EvaluationContext,
StandardEvaluationContext, SimpleEvaluationContext, PropertyAccessor,
IndexAccessor, MethodExecutor, and ConstructorExecutor has also been
updated to make these contracts discoverable via the API as well.

Closes gh-36968
2026-07-29 22:05:15 +03:00
Sam Brannen 2aaeef7190 Merge branch '7.0.x' 2026-07-29 21:38:13 +03:00
Sam Brannen 9b42a40a2a Document security implications of evaluating untrusted SpEL expressions
This commit clarifies in the Javadoc for EvaluationContext,
StandardEvaluationContext, and SimpleEvaluationContext (as well as in
the SpEL reference documentation) that StandardEvaluationContext must
never be used to evaluate expressions from an untrusted source, and
that SimpleEvaluationContext's restricted language and feature subset
is only a best-effort measure. The updated documentation also defines a
"trusted" source as a developer or administrator of the application and
points out that it is the responsibility of the code that configures an
EvaluationContext to ensure that no object reachable via the context
exposes dangerous operations.

Closes gh-36997
2026-07-29 21:21:11 +03:00
rstoyanchev 8bc5e11ec3 Remove HandlerMappingIntrospector
Closes gh-36481
2026-07-29 18:03:09 +03:00
rstoyanchev f53674d582 Replace HandlerMappingIntrospector with DefaultPreFlightRequestHandler
See gh-36481
2026-07-29 18:03:08 +03:00
rstoyanchev 67d54dccd2 Polishing contribution
See gh-36816
2026-07-29 16:17:54 +03:00
jhan0121 4bcae5305d Deprecate setDisallowedFields in DataBinder
Closes gh-36816
Signed-off-by: Juhwan Lee <jhan0121@gmail.com>
2026-07-29 16:17:09 +03:00
rstoyanchev 3f632382d6 Add WebClientResponseException.PreconditionFailed
See gh-36807
2026-07-29 15:55:04 +03:00
rstoyanchev cde75754bc Polishing in HttpClientErrorException
See gh-36807
2026-07-29 15:50:39 +03:00
Dominik Kovács dddd237449 Add HttpClientErrorException.PreconditionFailed
Closes gh-36807

Signed-off-by: Dominik Kovács <dominik.kovacs28@gmail.com>
2026-07-29 15:50:38 +03:00
rstoyanchev 56f7cc2dab Merge branch '7.0.x' 2026-07-29 15:18:45 +03:00
rstoyanchev 719311f09b Correct since tags
See gh-37090
2026-07-29 15:18:22 +03:00
Juergen Hoeller 91c6851f29 Merge branch '7.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2026-07-29 12:17:09 +02:00
Juergen Hoeller 28a78170b5 Upgrade to Tomcat 11.0.24, Jetty 12.1.11, Hibernate ORM 7.2.23, Hibernate Validator 9.1.3, Checkstyle 13.9 2026-07-29 12:14:26 +02:00
Juergen Hoeller 8fa7d88a0c Avoid getConnection lock for existing database transaction
Closes gh-37085
2026-07-29 11:30:17 +02:00
Juergen Hoeller 16d9965fe3 Consistently enforce non-null instance in AbstractFactoryBean
Closes gh-37091
2026-07-27 19:47:12 +02:00
rstoyanchev 1d1aac3674 Merge branch '7.0.x' 2026-07-27 12:58:34 +03:00
rstoyanchev b1d025d2c6 Update documentation on forwarded headers
See gh-37090
2026-07-27 12:46:43 +03:00
rstoyanchev 181a5d3403 Allow choice between Forwarded and X-Forwarded headers
This commit introduces a constructor argument to select whether
to use the standard "Forwarded" header or the "X-Forwarded-*"
alternative headers. A separate property to control support for
X-Forwarded-Prefix.

Closes gh-37090
2026-07-27 12:46:43 +03:00
Sam Brannen d5acf5bceb Merge branch '7.0.x' 2026-07-26 10:59:55 +03:00
Sam Brannen ae4214aa95 Do not reuse cached PropertyAccessor in Indexer without checking EvaluationContext
Prior to this commit, the SpEL Indexer's PropertyAccessorValueRef could
reuse a cached PropertyAccessor for reads and writes even after that
accessor had been removed from the current EvaluationContext, leading
to stale property access if the EvaluationContext changes between
evaluations of the same expression.

This commit aligns PropertyAccessorValueRef with the analogous logic
in PropertyOrFieldReference and Indexer's IndexAccessorValueRef by
verifying that the cached PropertyAccessor is still registered in the
current EvaluationContext before reusing it in getValue() and
setValue().

Closes gh-36986
2026-07-26 10:56:44 +03:00
Sam Brannen 4c192bf58f Merge branch '7.0.x' 2026-07-26 10:21:32 +03:00
Sam Brannen 4f086322d0 Do not reuse cached ConstructorExecutor without ConstructorResolvers
Prior to this commit, a SpEL ConstructorReference could reuse a cached
ConstructorExecutor even when the current EvaluationContext no longer
had any registered ConstructorResolvers, leading to inconsistent
behavior if the EvaluationContext changes between evaluations of the
same expression.

This commit aligns ConstructorReference with the analogous logic in
PropertyOrFieldReference by discarding the cached ConstructorExecutor
whenever there are no ConstructorResolvers registered in the current
EvaluationContext, ensuring that constructor resolution consistently
fails with a CONSTRUCTOR_NOT_FOUND exception in that scenario.

Closes gh-36985
2026-07-25 16:05:23 +03:00
Sam Brannen cb6226c98a Merge branch '7.0.x' 2026-07-25 11:06:31 +03:00
Alexis SEGURA e255ccca7d Update Javadoc for active profile ordering
Following gh-26004, the registration order of active profiles in
@⁠ActiveProfiles is preserved; however, the Javadoc in
MergedContextConfiguration and WebMergedContextConfiguration still
described the old sorting behavior, which is misleading since profile
order is part of the context cache key (equals/hashCode).

This commit updates the Javadoc to document the status quo.

Closes gh-36950

Signed-off-by: Alexis SEGURA <alex.segura06@gmail.com>
2026-07-25 11:04:11 +03:00
rstoyanchev ffcf37468f Update documentation on forwarded headers
See gh-37072
2026-07-24 22:31:52 +03:00
Brian Clozel e24f5f2ca7 Merge branch '7.0.x' 2026-07-24 15:15:52 +02:00
Brian Clozel b5de644cbb Do not deploy org.springframework:framework-docs on Central
Fixes gh-36879
2026-07-24 15:15:22 +02:00
Brian Clozel 079992021c Improve MimeType parser for RFC compliance
Prior to this commit, the `MimeType` class would compare raw parameter
values for the equals/hashcode contract. This went against the RFC which
states that quoted and unquoted parameter values are equivalent.

This commit rewrote the entire `MimeType` parser in `MimeTypeUtils`
as a state parser to improve robustness and performance.
The `MimeType` equals, compareTo and hascode contracts now unquote
parameter values before comparing them.

This change also optimizes the `tokenize` function that splits many
comma-separated MIME types into a list. Now that this method isn't used
anywhere else, it is also deprecated as of 7.1. This method was
initially made public to be reused within Spring Framework and has no
particular use in Spring applications in general.

Finally, this also makes `MediaType` and `MimeType` leverage the
`MimeType` LRU cache as much as possible, including when parsing
`Accept:` HTTP headers.

Closes gh-36729
2026-07-24 14:29:36 +02:00
rstoyanchev 9bdeadcfbd Deprecate historic forwarded header behavior
See gh-37072
2026-07-23 12:15:24 +03:00
rstoyanchev 31c37d4f2c Require choice between Forwarded and X-Forwarded headers
This commit introduces a constructor argument to select whether
to use the standard "Forwarded" header or the "X-Forwarded-*"
alternative headers. A separate property enables support for
X-Forwarded-Prefix.

Closes gh-37072
2026-07-23 12:15:24 +03:00
rstoyanchev 68862530fb Parse the standard "Forwarded" header directly
This commit introduces manual parsing of the standard "Forwarded"
header instead of using regular expressions.

Closes gh-36964
2026-07-23 12:15:24 +03:00
rstoyanchev 7b71df72e5 Add ForwardedInfo to ForwardedHeaderUtils
This commit adds two new methods in ForwardedHeaderUtils, one to parse
the standard "Forwarded" header only, and another to parse the
"X-Forwarded-*" alternative headers. As those are single parse methods,
a ForwardedInfo container type is necessary to return the results.

See gh-36964
2026-07-23 12:15:24 +03:00
Brian Clozel 224522244f Merge branch '7.0.x' 2026-07-22 10:54:58 +02:00
Brian Clozel 7de2b24d81 Fix primitive array annotation attributes on Java 24 class reading
Prior to this commit, `ClassFileAnnotationDelegate#parseArrayValue`
would only consider `int[]`, `double[]` and `long[]` array
annotation attributes; other primitive array types like `byte[]`
would use a generic path that would use boxed types.

This commit ensures that a comprehensive pass is made for all
primitive typed arrays. Because the `AnnotationValue` hierarchy
is sealed, we can now maje sure that the implementation is
exhaustive.

Closes gh-37083
2026-07-22 10:50:07 +02:00
Tran Ngoc Nhan 1502ab0b20 Correct HandlerMethodValidationExceptionTests package
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-07-21 15:54:53 +03:00
Sam Brannen 304f8eb27e Merge branch '7.0.x' 2026-07-21 12:00:08 +03:00
Sam Brannen b90624472e Polish Javadoc for ProtobufDecoder 2026-07-21 11:57:20 +03:00
BAE JAE HYEON 1600e2479b Fix Javadoc in ProtobufDecoder's MessageSizeReader API
Previously, the @⁠return tag in MessageSizeReader.readMessageSize() was
followed by a redundant "return", which rendered as "Returns: return
the message size..." in the published API documentation.

Closes gh-37079

Signed-off-by: BAE JAE HYEON <roblery128@gmail.com>
2026-07-21 11:53:24 +03:00
Sébastien Deleuze 3dfb4ef754 Upgrade Kotlin Coroutines to 1.11.0
Closes gh-37076
2026-07-20 15:30:59 +02:00
Sébastien Deleuze 08a4844288 Upgrade Kotlin to 2.4.10
Closes gh-37074
2026-07-20 15:30:58 +02:00
Sam Brannen 38e1bf5970 Merge branch '7.0.x' 2026-07-20 11:07:00 +03:00
Manu Sridharan 233725c8f5 Add @⁠Nullable annotations when treating Map.remove() as returning @⁠Nullable
Closes gh-37067

Signed-off-by: Manu Sridharan <msridhar@gmail.com>
2026-07-20 11:02:55 +03:00
Brian Clozel 5ac20a8104 Reinstate invalid resource location checks
This checks was removed previously because the location was considered
as invalid in #36695, but they were later reinstated in #36692.

This commit also reinstates the check that prevents static resource
resolution in those locations.

Closes gh-37063
2026-07-17 13:41:38 +02:00