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
agent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)priority:p3refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code
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).
[agent] The audit-core run of 2026-11-01 found a sixth interpolation path inside formats::maven itself.
PomDep.version goes through resolve_property (mod.rs L302-L312).`` That path resolves only one level, only a whole-string ${x}, and only from root properties. Coordinates go through `interpolate` (L323-L372),``` which handles nesting, model refs and user properties.
Executed in a scratch test on cbbbdb9: parse_pom_with returned the versions ${base} (nested), ${project.version} and ${user.v} (from maven.config -Duser.v=9.9) unresolved, while ${g} in groupId resolved. VEX discovery reads these versions, so a patched dependency declared with them yields no attestation.
The fix belongs in this issue's single helper: route versions through interpolate with the coordinate refs.
agent:triagedarch-auditFiled by a scheduled architecture audit routine (see the architecture review discussion)priority:p3refactorStructural change: duplicated code or logic, missing abstraction, layering, dead code
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
mikolalysenko commentedon Nov 1, 2026
[agent] The audit-core run of 2026-11-01 found a sixth interpolation path inside
formats::mavenitself.PomDep.versiongoes throughresolve_property(mod.rs L302-L312).`` That path resolves only one level, only a whole-string${x}, and only from root properties. Coordinates go through `interpolate` (L323-L372),``` which handles nesting, model refs and user properties.Executed in a scratch test on
cbbbdb9:parse_pom_withreturned the versions${base}(nested),${project.version}and${user.v}(from maven.config-Duser.v=9.9) unresolved, while${g}in groupId resolved. VEX discovery reads these versions, so a patched dependency declared with them yields no attestation.The fix belongs in this issue's single helper: route versions through
interpolatewith the coordinate refs.Generated by Claude Code