Found by the red-team over testifysec/judge#5559 (pre-existing — byte-identical to main, comment-only diff).
cilock/cli/inclusion_bridge.go expandSubjectsWithInclusionProofs runs at verify.go:438 on RAW loaded envelopes before any DSSE/functionary signature check. The loop at ~214-238 is ~P×C p.Verify calls when all proofs share one root and all fail (the added[p.TreeRoot] short-circuit and the break are never reached); each iteration re-decodes the audit path. One 512 MiB bundle of ~1 KB envelopes split into ~250K inclusion-proof envelopes + matching commitments → ~6e10 verify calls → hours-to-days hang. The always-inline change makes the sibling per-commitment BuildSidecar loop unconditionally reachable, compounding it.
Fix: cap the number of proofs+commitments processed (or dedup commitments by root and proofs by (FileDigest,TreeRoot)) before the nested loop; break the inner loop after the first matching-root commitment regardless of Verify outcome; decode each audit path once per proof. Bound the whole pre-auth pass.
Found by the red-team over testifysec/judge#5559 (pre-existing — byte-identical to main, comment-only diff).
cilock/cli/inclusion_bridge.goexpandSubjectsWithInclusionProofsruns at verify.go:438 on RAW loaded envelopes before any DSSE/functionary signature check. The loop at ~214-238 is ~P×Cp.Verifycalls when all proofs share one root and all fail (theadded[p.TreeRoot]short-circuit and the break are never reached); each iteration re-decodes the audit path. One 512 MiB bundle of ~1 KB envelopes split into ~250K inclusion-proof envelopes + matching commitments → ~6e10 verify calls → hours-to-days hang. The always-inline change makes the sibling per-commitmentBuildSidecarloop unconditionally reachable, compounding it.Fix: cap the number of proofs+commitments processed (or dedup commitments by root and proofs by (FileDigest,TreeRoot)) before the nested loop; break the inner loop after the first matching-root commitment regardless of Verify outcome; decode each audit path once per proof. Bound the whole pre-auth pass.