Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make maximum SpEL expression length configurable #30380

Closed
Wosch96 opened this issue Apr 26, 2023 · 12 comments
Closed

Make maximum SpEL expression length configurable #30380

Wosch96 opened this issue Apr 26, 2023 · 12 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: regression A bug that is also a regression
Milestone

Comments

@Wosch96
Copy link

Wosch96 commented Apr 26, 2023

After updating to a recent version of spring-boot(2.7.9 -> 2.7.11). We run in a problem with our thymeleaf template, that has a SpEL expression with more than 10000 characters (whitespaces etc. reach the 10000 pretty fast if you want the SpEL readable). The character limit of 10000 (released in version 5.2.24) was released with spring-boot 2.7.11 as the spring-framework was updated to 5.3.27.

Is there a possibility that this MAX_EXPRESSION_LENGTH in the class InternalSpelExpressionParser can be made settable or maybe turned off? In the Issue #30329 and the linked storys I did not find any clue why this change had to be done. If there is any clue, please point me to the direction.

Best regards,
Jonas

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 26, 2023
@bclozel bclozel added the in: core Issues in core modules (aop, beans, core, context, expression) label Apr 26, 2023
@mdeinum
Copy link
Contributor

mdeinum commented Apr 26, 2023

Related: #30265

@sbrannen
Copy link
Member

sbrannen commented Apr 26, 2023

As pointed out by @mdeinum, this is indeed related to the discussions in #30265.

@Wosch96, we may consider increasing the max length restriction, but before we do that could you please answer the following questions?

  1. Can you provide an example of one of the SpEL expressions you are using that are longer than 10,000 characters (if not publicly, then perhaps via a private communication channel such as email)?
  2. Would it be possible for you to move some of the logic contained in the SpEL expression to a static utility function or to a method within a registered bean?
  3. If we were to change the max length, what is the smallest "max length" that would be suitable for your application?

@sbrannen sbrannen added the status: waiting-for-feedback We need additional information before we can continue label Apr 26, 2023
@sbrannen sbrannen changed the title MAX_EXPRESSION_LENGTH too short SpEL MAX_EXPRESSION_LENGTH is too short Apr 26, 2023
@sbrannen sbrannen changed the title SpEL MAX_EXPRESSION_LENGTH is too short SpEL MAX_EXPRESSION_LENGTH is too short Apr 26, 2023
@Wosch96
Copy link
Author

Wosch96 commented Apr 27, 2023

@sbrannen

In our case, we use thymeleaf to create a template for a class.

Example Class (minimal scaled case):

class X { variable a; variable b; variable c; variable d; variable e;}

Our SpEL function (minimal scaled case):

ctx = class X
model.convert(ctx, { "Example header": {"a", "b", "c"} }, "Example header 2": {"d", "e"} }

The convert method handels the further usage of the values. We basically use the SpEL to feed variables and headers to the thymeleaf template.

Right now this SpEL is written without many whitespaces etc. but to keep this SpEL readable (talking about 30 variables and headers +), we ofc used some whitespaces and newlines. This also adds to the expression length and hits the 10000 characters mark. Right now I think we have about 15000 characters.

The class variables keep growing over time as more functionality is added. Therefore, as the SpEL keeps growing we would need a complete new alternative to build our SpEL. Right now, our best choice is to use an older version of the spring-framerwork, which has no MAX_EXPRESSION_LENGTH set.

If we were to change the max length, what is the smallest "max length" that would be suitable for your application?

With the explanation above and the growing expression, I don't think I can declare a max length that can never be reached.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 27, 2023
@rPraml
Copy link

rPraml commented Apr 27, 2023

For our use case, it would be sufficient, if the max-expression-length lives in the SpelParserConfiguration

If set to zero (or MAX_INT), no limitation happens.

@sbrannen
Copy link
Member

Hi @Wosch96 and @rPraml,

Thanks for the feedback!

Two more questions...

  1. Am I correct in assuming that you have full control over your use of SpEL (instantiation of the SpelExpressionParser, which EvaluationContext you are using, etc.)?
  2. Are you only using SpEL to evaluate expressions created within your application (i.e., not expressions supplied by external or untrusted sources)?

@sbrannen sbrannen added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Apr 28, 2023
@rPraml
Copy link

rPraml commented Apr 30, 2023

@sbrannen 1. yes and 2. yes.

We instantiate a custom parser and pass it to Thymeleaf, so that we can generate HTML reports.

The report definition contains some bigger SpEL expressions that are passed to helper objects (like HTML table generators).

These definitions come from a trusted source and are not editable by the user.

In our case we could pass an individual SpelParserConfiguration, where the limit check is disabled (or set to a high enough value).

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 30, 2023
@sbrannen sbrannen self-assigned this Apr 30, 2023
@sbrannen sbrannen added type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on status: feedback-provided Feedback has been provided labels Apr 30, 2023
@sbrannen sbrannen added this to the 6.0.9 milestone Apr 30, 2023
@sbrannen sbrannen added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.3.x labels May 8, 2023
@sbrannen sbrannen changed the title SpEL MAX_EXPRESSION_LENGTH is too short Make SpEL MAX_EXPRESSION_LENGTH configurable via SpelParserConfiguration May 8, 2023
@sbrannen sbrannen changed the title Make SpEL MAX_EXPRESSION_LENGTH configurable via SpelParserConfiguration Make SpEL MAX_EXPRESSION_LENGTH configurable May 8, 2023
@rPraml
Copy link

rPraml commented May 10, 2023

@sbrannen Thanks, the change in aefcb9d looks good to me 👍
Will test with next release.

@tsposato
Copy link

@sbrannen Thanks, the change in aefcb9d looks good to me 👍 Will test with next release.

We are also running into this issue after upgrade to spring-boot 2.7.18 - where exactly can I configure this?

@sbrannen
Copy link
Member

sbrannen commented Jan 12, 2024

@tsposato, in which context are you running into this issue?

If you are using SpEL programmatically, you can configure the max length when instantiating the SpelParserConfiguration which you then supply to the SpelExpressionParser.

If you are referring to SpEL expressions used within the ApplicationContext -- for example in XML bean definitions, @Value, etc. -- you can specify the max length via a JVM system property or Spring property named spring.context.expression.maxLength beginning with Spring Framework 6.1.3.

See Parser Configuration for details.

@tsposato
Copy link

@sbrannen, we are using thymeleaf to create our template (which has a number of embedded base64 images going well over the limit), and then converting it to a PDF so a lot of the SpEL is not visible to us. It looks like spring-boot 2.7.18 uses Spring Framework 5.3.31 so that property doesn't work for my use case.

I'm not really sure what my options are here other than embedding the images in another way besides base64 which is proving somewhat difficult...

@sbrannen
Copy link
Member

@tsposato, you will need to configure the SpelExpressionParser that Thymeleaf uses.

See #30380 (comment) above for details.

@tsposato
Copy link

@sbrannen 1. yes and 2. yes.

We instantiate a custom parser and pass it to Thymeleaf, so that we can generate HTML reports.

The report definition contains some bigger SpEL expressions that are passed to helper objects (like HTML table generators).

These definitions come from a trusted source and are not editable by the user.

In our case we could pass an individual SpelParserConfiguration, where the limit check is disabled (or set to a high enough value).

Did this work for you? Do you have a snippet of how you did it?

j-sandy added a commit to j-sandy/echo that referenced this issue Jun 26, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446

2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986

Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/kork that referenced this issue Jun 26, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/orca that referenced this issue Jun 26, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/kork that referenced this issue Jun 26, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/echo that referenced this issue Jun 26, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446

2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986

Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/orca that referenced this issue Jun 27, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/kork that referenced this issue Jul 1, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/kork that referenced this issue Jul 1, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/kork that referenced this issue Jul 1, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/orca that referenced this issue Jul 1, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/echo that referenced this issue Jul 1, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446

2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986

Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/echo that referenced this issue Jul 1, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446

2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986

Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/echo that referenced this issue Jul 2, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446

2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986

Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
j-sandy added a commit to j-sandy/echo that referenced this issue Jul 2, 2024
…xpressions

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446

2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986

Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.
mergify bot added a commit to spinnaker/kork that referenced this issue Jul 2, 2024
…xpressions (#1193)

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify bot added a commit to spinnaker/orca that referenced this issue Jul 2, 2024
…xpressions (#4755)

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446
2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986
Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify bot added a commit to spinnaker/echo that referenced this issue Jul 2, 2024
…xpressions (#1429)

Spring Expression Lanuage (SpEL) has a default limit of 10,000 characters. Springframework provides the feature to configure the limit. This feature allows to configure the limit of characters for SpEL expressions.

Approach:
In order to use an expression with characters more than the given default limit, require to follow either of the below approaches:
1. For Springframework >=5.3.28 and <6.1.3, by setting `maximumExpressionLength` field while instantiating the custom `SpelParserConfiguration` class.
spring-projects/spring-framework#30380
spring-projects/spring-framework#30446

2. For Springframework >=6.1.3, by setting a JVM system property or Spring property named `spring.context.expression.maxLength` to the maximum expression length needed by your application.
spring-projects/spring-framework#31952
spring-projects/spring-framework@7855986

Spinnaker supports spring boot 2.7.18, that brings springframework 5.3.31 [https://docs.spring.io/spring-boot/docs/2.7.18/reference/html/dependency-versions.html#appendix.dependency-versions.propertie9]. So first approach need to be implemented along with spinnaker enhancement to expose the `maximumExpressionLength` field.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

7 participants