You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SECURITY] Request: Add recursion depth limit to KlvDecoder #6934
Security Request: Recursion Depth Limit in KlvDecoder
Requested By: Alliance project (codice/alliance) Issue: Uncontrolled recursion in KlvDecoder allows stack overflow DoS attacks CVSS: 7.5 (High) Alliance Tracking:montge/alliance#53
Problem
DDF's KlvDecoder.decode() recursively processes nested KlvLocalSet structures without depth limits. This enables Denial of Service attacks via deeply nested KLV structures.
Attack Scenario:
Malicious MPEG-TS stream with 5,000-10,000 nested KLV Local Sets
→ KlvDecoder.decode() recursively processes each level
→ Stack overflow after ~1,000-5,000 levels (platform dependent)
→ JVM crash → DoS
Affected Code:
org.codice.ddf.libs.klv.KlvDecoder.decode()
Used by: Alliance STANAG 4609 FMV processing, DDF metadata extraction
Proposed Fix
Add maximum recursion depth parameter to KlvDecoder:
Alliance has implemented best-effort pre-validation in KlvSecurityValidator that scans KLV structure before decoding. This provides partial protection but cannot catch all nesting patterns without fully duplicating KlvDecoder logic.
Activity
Security: Add recursion depth limit to KlvDecoder to prevent DoS attacks
montge commentedon Dec 4, 2025
A fix for this security vulnerability has been committed to the DDF codebase:
Commit: f79aca3 - "Security: Add recursion depth limit to KlvDecoder to prevent DoS attacks"
Changes:
KlvDecodernow tracks recursion depth when decoding nestedKlvLocalSetstructuresKlvDecodingExceptionthrown when depth limit exceededThis prevents malicious MPEG-TS streams with thousands of nested KLV Local Sets from causing JVM stack overflow crashes.
The fix is now available in the master branch.
montge commentedon Dec 6, 2025
Fixed in commit f79aca3 - Added MAX_RECURSION_DEPTH limit to KlvDecoder to prevent stack overflow DoS attacks from deeply nested KLV structures.