Deferred (pre-existing) finding from the PR #161 code review — not introduced by #161.
Problem
deep_merge_yaml bounds merge recursion at MAX_FRONTMATTER_MERGE_DEPTH (64), but the upstream serde_yaml_ng::from_str parse of frontmatter (before the merge, at the parse site in crates/mds-core/src/resolver/frontmatter.rs) and the deep clone() / Drop of nested mappings are not covered by that cap — they are bounded only by MAX_FILE_SIZE (10 MB).
A deeply-nested or alias-bombed adversarial frontmatter document can cause a parse-time stack blow-up. That abort is not catchable by catch_unwind at the JS/Python FFI boundary and can take down the host process.
Proposed fix
Cap YAML nesting depth at parse time (before/at deserialization), surfacing a clean mds:: error instead of aborting.
Notes
Deferred (pre-existing) finding from the PR #161 code review — not introduced by #161.
Problem
deep_merge_yamlbounds merge recursion atMAX_FRONTMATTER_MERGE_DEPTH(64), but the upstreamserde_yaml_ng::from_strparse of frontmatter (before the merge, at the parse site incrates/mds-core/src/resolver/frontmatter.rs) and the deepclone()/Dropof nested mappings are not covered by that cap — they are bounded only byMAX_FILE_SIZE(10 MB).A deeply-nested or alias-bombed adversarial frontmatter document can cause a parse-time stack blow-up. That abort is not catchable by
catch_unwindat the JS/Python FFI boundary and can take down the host process.Proposed fix
Cap YAML nesting depth at parse time (before/at deserialization), surfacing a clean
mds::error instead of aborting.Notes
depythonizeobject-graph walk is tracked in tech-debt: bound depythonize recursion depth in native bindings (stack-overflow hardening) #134; this issue is the distinct mds-core YAML text parse site.