Repository navigation
fix(security): patch CVE-2022-41404 DoS vulnerability (CRITICAL) - #10
Merged
Merged
Conversation
Implement configurable recursion depth limit to prevent stack overflow
from circular variable references in INI file variable substitution.
**Changes:**
- Add CircularReferenceException for clear error reporting
- Add Config.maxResolveDepth property (default: 16, configurable via
-Dorg.ini4j.config.maxResolveDepth=N)
- Implement depth tracking through fetchInternal() methods in
BasicProfile and BasicOptionMap
- Add package-protected getConfig() methods for config access
- Add hasVariableSubstitution() helper to check for ${...} patterns
**Security Impact:**
CVE-2022-41404: Denial of Service via infinite recursion
- Attack vector: Circular references like [a] x=${b/y} and [b] y=${a/x}
- Impact: StackOverflowError crashes JVM
- Mitigation: Throw CircularReferenceException when depth limit exceeded
**Testing:**
- Add 3 regression tests for circular reference detection:
* BasicProfileTest.testFetchRecursiveInfiniteLoop
* BasicOptionMapTest.testFetchCircularReference
* BasicProfileSectionTest.testFetchCircularReferenceAcrossSections
- All 206 tests passing
**Acknowledgments:**
Thanks to [bingdian](https://sourceforge.net/u/bingdians/profile/)
for the original vulnerability report on SourceForge ticket #56.
Additional thanks to Marc Lafon, paradox, and Craig for their
contributions to identifying and documenting this issue.
Fixes #6
5 tasks
szkiba
deleted the
security-fix-patch-cve-2022-41404-dos-vulnerability
branch
January 30, 2026 18:43
10 of 18 tasks
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.
Implement configurable recursion depth limit to prevent stack overflow from circular variable references in INI file variable substitution.
Changes
Security Impact
CVE-2022-41404: Denial of Service via infinite recursion
Testing
Acknowledgments
Thanks to bingdian for the original vulnerability report on SourceForge ticket #56.
Additional thanks to Marc Lafon, paradox, and Craig for their contributions to identifying and documenting this issue.
Fixes #6