fix(config): add depth limit to deep_merge (#3931)#3961
Merged
mrveiss merged 2 commits intoDev_new_guifrom Apr 8, 2026
Merged
Conversation
… ChromaDB systemd service Resolves chromadb startup failure due to protobuf version conflict (7.34.1 with opentelemetry-exporter-otlp-proto-grpc 1.11.1). Error was: 'Descriptors cannot be created directly' when loading opentelemetry proto files. The workaround sets PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python to use pure-Python protobuf parsing instead of compiled C extension, allowing chromadb to start and KB to initialize properly. Issue #3939 (KB_INIT_FAILED HTTP 503) — deployment config only, no code changes. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add max_depth parameter (default: 10) to deep_merge function - Prevent O(n) recursion on adversarially nested config files - Raises ValueError if nesting exceeds max_depth - Protects all non-sync config load/reload code paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
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.
Closes #3931
Problem
deep_merge in config/loader.py had no depth limit on non-sync paths, allowing adversarial nested configs to trigger O(n) recursion.
Solution
Testing
Depth limit validation with nested dicts