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
Interpolate Maven ${...} properties through one formats::maven helper: five copies drifted on recursion, undefined names and the length cap #1887
The last three are the same loop body, differing only in how they call the lookup:
whileletSome(at) = rest.find("${"){
out.push_str(&rest[..at]);let after = &rest[at + 2..];let close = after.find('}')?;let raw = lookup(&after[..close])?;
out.push_str(&interpolate_by(&raw, lookup, depth + 1)?);
rest = &after[close + 1..];}
Only formats::maven caps the output length. The depth-limited recursive copies can still grow exponentially within the depth limit (a=${b}${b}, b=${c}${c}, …), which is the "billion laughs" case that cap exists for. This is from reading the code; I did not execute it.
Proposed change
Add formats::maven::interpolate_by(value, lookup: &dyn Fn(&str) -> Option<String>) -> Option<String>. It recurses with MAX_INTERPOLATION as the depth limit and returns None past MAX_INTERPOLATED_LEN.
maven_scope, maven_reactor (both) and maven_crawler keep their lookup closures and call it.
maven_crawler's settings.xml use is non-recursive today. Maven itself interpolates settings.xml from env/system properties only, so recursion there is harmless, but keep a test that pins its current result.
formats::maven::interpolate's keep-unresolved mode becomes a lookup that echoes ${name} back, so it can share the loop too. If that changes its output, it can stay as the one separate wrapper.
Size
4 files, about −70 lines.
Acceptance criteria
Behavior is unchanged for in-cap inputs. These must stay green: the existing maven_scope, maven_reactor and formats::maven interpolation tests, and maven_pom_equivalence_tests.rs.
Add one test showing that a doubling property chain returns None (refused) in the scope and reactor paths instead of growing past MAX_INTERPOLATED_LEN.
[agent] Triaged: priority:p3 (Maven). Confirmed on main: the five ${...} loops are at maven_crawler::interpolate, formats::maven::interpolate/interpolate_once, maven_scope::interpolate_at, and maven_reactor::interpolate_by / Reactor::interpolate_with. No duplicate or open PR found. Not clustered with #1809 (that one is about reactor detection, not property interpolation).
Activity
audit-core: crawlers composer..maven, A30-A39, file #1887-#1889
mikolalysenko commentedon Oct 30, 2026
[agent] Triaged: priority:p3 (Maven). Confirmed on main: the five
${...}loops are atmaven_crawler::interpolate,formats::maven::interpolate/interpolate_once,maven_scope::interpolate_at, andmaven_reactor::interpolate_by/Reactor::interpolate_with. No duplicate or open PR found. Not clustered with #1809 (that one is about reactor detection, not property interpolation).Generated by Claude Code