-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Add a size limit to outputs from mustache #114002
Conversation
modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java
Outdated
Show resolved
Hide resolved
modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/common/text/SizeLimitingStringWriter.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, but I think we should be much more restrictive in the size.
modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/common/text/SizeLimitingStringWriter.java
Outdated
Show resolved
Hide resolved
Add a setting to configure size limit Add a test
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @thecoop, I've created a changelog YAML for you. |
modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK if you want to have Ryan final opinion, but I see his concerns were addressed and looks good to me too.
@elasticmachine rerun elasticsearch-ci/part-1 |
Test failures are #114296 |
💚 Backport successful
|
In elastic#114002 the maximum size of a mustache script output was made configurable. However, the setting was not registered. This commit registers the setting so that it can be set in elasticsearch.yml.
In #114002 the maximum size of a mustache script output was made configurable. However, the setting was not registered. This commit registers the setting so that it can be set in elasticsearch.yml.
In elastic#114002 the maximum size of a mustache script output was made configurable. However, the setting was not registered. This commit registers the setting so that it can be set in elasticsearch.yml.
In elastic#114002 the maximum size of a mustache script output was made configurable. However, the setting was not registered. This commit registers the setting so that it can be set in elasticsearch.yml.
* Register mustache size limit setting (#119291) In #114002 the maximum size of a mustache script output was made configurable. However, the setting was not registered. This commit registers the setting so that it can be set in elasticsearch.yml. * fix compile * fix compile * fix test compile * fix license header
This limits the size of strings that could be created from mustache templates