Skip to main content

MAX_MERGE_PATCH_DEPTH

Constant MAX_MERGE_PATCH_DEPTH 

Source
pub const MAX_MERGE_PATCH_DEPTH: usize = 32;
Expand description

Maximum recursion depth for json_merge_patch application.

Beyond this depth the patch is silently ignored at the affected sub-tree: the target value at that level is left unchanged. Mitigates stack DoS from adversarial PatchObject values (bd:JMAP-sc1b.97). 32 levels comfortably exceeds any legitimate JMAP /set update shape — the deepest standard JMAP /set update shape (Email with nested bodyStructure) tops out around 6 levels.