Problem
- SEC-005:
compose/extends.rs resolution is unbounded — a deeply nested extends: chain (or cross-file chain) causes a stack overflow, crashing the process (DoS).
- EXT-001: Cross-file circular
extends: (A.yml:svc extends B.yml:svc extends A.yml:svc) is not detected and causes unbounded recursion.
Fix
Add a depth counter to resolve_one_extends and resolve_one_extends_in_memory. Return Err(ComposeError::Extends(...)) when depth exceeds 16.
The same depth limit naturally caps cross-file circular chains.
Problem
compose/extends.rsresolution is unbounded — a deeply nestedextends:chain (or cross-file chain) causes a stack overflow, crashing the process (DoS).extends:(A.yml:svc extends B.yml:svc extends A.yml:svc) is not detected and causes unbounded recursion.Fix
Add a depth counter to
resolve_one_extendsandresolve_one_extends_in_memory. ReturnErr(ComposeError::Extends(...))when depth exceeds 16.The same depth limit naturally caps cross-file circular chains.