-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Increase max regex length in SpEL expressions #30265
Comments
@quaff I understand the security concerns but then I'd suggest to make this max regex length value configurable: we do have some lengthy regexes that fail with the new version |
Hi @agolovenko, Thanks for reporting the issue. We may consider increasing the max size restriction, but before we do that could you please answer the following questions?
|
Hi @sbrannen ,
|
I suggest you extract this into a static method, then call method in SpEL like this |
Thanks for providing feedback, @agolovenko. Out of curiosity, what do you mean by "generated"? Is the expression generated by a custom tool that is internal to your application? In other words, is the generator a trusted source? Since you state that you are manually creating the When evaluating against a In addition, you can move more complex business logic to a
We do not plan to make any restrictions on SpEL operators configurable. In light of that, please let us know if either of the aforementioned alternatives works for you. Thanks |
As mentioned previously, we do not have plans to make the max regex length configurable; however, we are willing to increase it from 256 to 1024 in order to support use cases where a regex may be rather lengthy due to inclusion of several options in an In light of that, I am repurposing this issue to address that. |
This commit changes the max regex length in SpEL expressions from 1024 to 1000 in order to consistently use "round" numbers for recently introduced limits. See gh-30265
This commit changes the max regex length in SpEL expressions from 1024 to 1000 in order to consistently use "round" numbers for recently introduced limits. See gh-30265
This commit changes the max regex length in SpEL expressions from 1024 to 1000 in order to consistently use "round" numbers for recently introduced limits. See gh-30265
This commit changes the max regex length in SpEL expressions from 1024 to 1000 in order to consistently use round numbers for recently introduced limits. See spring-projectsgh-30265
In version
6.0.7
ofspring-expression
there was a method added calledcheckRegexLength
:spring-framework/spring-expression/src/main/java/org/springframework/expression/spel/ast/OperatorMatches.java
Lines 120 to 125 in 69c8f8e
It is adding a
256
char limit check on a length of a regex in a SpEL expression. We actually use longer regexes. Why would you put this limit? Seems quite random.Please remove this check or at least make that max regex length value configurable.
The text was updated successfully, but these errors were encountered: