Bound _get_masked_values recursion depth

Add _depth/_max_depth guards (default 20) so the nested dict masking
cannot run away, and allowlist the function in the recursive_detector
CI check alongside the other bounded recursive helpers.
This commit is contained in:
Yuneng Jiang
2026-04-24 13:00:33 -07:00
parent 96ba35eed4
commit e7f4e77af0
2 changed files with 7 additions and 0 deletions
@@ -45,6 +45,7 @@ IGNORE_FUNCTIONS = [
"_convert_to_json_serializable_dict", # max depth set (default 20) and circular reference protection to prevent infinite recursion.
"dict", # max depth set. _LiteLLMParamsDictView.dict() calls builtin dict(), not itself.
"_read_image_bytes", # max depth set.
"_get_masked_values", # max depth set (default 20) to prevent infinite recursion while masking nested sensitive config dicts.
]