doveadm-http: increase max_string_size for json parser - #315
Open
errror wants to merge 1 commit into
Open
Conversation
as json can contain whole sieve scripts as a string, increase the (default) max allowed string size for sieve scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
as json can contain whole sieve scripts as a string, increase the (default) max allowed string size for sieve scripts
Pull Request
If this pull request fixes, discloses, demonstrates or discusses a suspected security vulnerability,
DO NOT submit it publicly. Follow SECURITY.md and report it privately.
AI policy
Dovecot allows AI assisted or generated code, but we would like to know if it is such.
Do not include 'Co-Authored-By' header in the commit.
Type of Change
Description
Submitting large sieve scripts via
sievePutREST API calls fails. The sieve plugin allows up to 1M size of sieve script (by default), see https://doc.dovecot.org/2.4.5/core/plugins/sieve.html#sieve_max_script_size. But the JSON parser only allows 32K for string parameters. This patch increases this limit to 1M (similar to sieve) for the JSON parser for doveadm HTTP connections.Additional Notes
Technically it might be possible to read out the
sieve_max_script_sizesetting here and use this value (if found). But as the setting is already advanced and looking up a plugin setting in the core code seems not a good idea (and probably complicated too), I decided for this simple solution. It would also possible to provide a settings variable to allow users to set the variable to higher values. Let me know, if I should improve the PR to provide such a setting.