docs(solutions): capture ReDoS learning from plugin trust-boundary inversion#353
Conversation
…version Documents the CodeQL ReDoS finding that surfaced during PR #352's multi-load registration cycle. The marker regex itself never changed — the trust boundary around it did. Architectural changes that expand the set of input authors can reclassify a previously safe regex as unsafe. Documents the rejected alternatives (bounded-length cap, atomic groups, inline CodeQL suppression), the indexOf/slice solution, the regression test shape, and four prevention rules. Cross-references three adjacent learnings: the PR #335 origin doc that PR #352 reverted, the config overlay trust-boundary doc, and the agent-color schema regression.
fro-bot
left a comment
There was a problem hiding this comment.
Verdict: PASS
Clean, well-structured compound doc that accurately captures a security learning. Frontmatter is valid, cross-references resolve, and the technical explanation is correct.
Blocking issues
None
Non-blocking concerns
None
Missing tests
None — this is a documentation-only PR. The regression test it references already exists in (lines 579–597) and was validated in this review.
Risk assessment (LOW) + rationale
This change adds a single markdown file under , a directory already excluded from the content-integrity gate by design. No code paths are modified. No plugin API surfaces are touched. The only risk is stale documentation, but the After code snippets match at HEAD exactly and the referenced regression test exists and passes. Blast radius is zero.
Run Summary
| Field | Value |
|---|---|
| Event | pull_request |
| Repository | marcusrbrown/systematic |
| Run ID | 25658621158 |
| Cache | hit |
| Session | ses_1e9e17368ffe8ExsUlvqo0Z8zo |
fro-bot
left a comment
There was a problem hiding this comment.
Verdict: PASS
Clean, well-structured compound doc that accurately captures a security learning. Frontmatter is valid, cross-references resolve, and the technical explanation is correct.
Blocking issues
None
Non-blocking concerns
None
Missing tests
None — this is a documentation-only PR. The regression test it references already exists in tests/unit/plugin.test.ts (lines 579–597) and was validated in this review.
Risk assessment (LOW) + rationale
This change adds a single markdown file under docs/solutions/security-issues/, a directory already excluded from the content-integrity gate by design. No code paths are modified. No plugin API surfaces are touched. The only risk is stale documentation, but the "After" code snippets match src/index.ts at HEAD exactly and the referenced regression test exists and passes. Blast radius is zero.
Run Summary
| Field | Value |
|---|---|
| Event | pull_request |
| Repository | marcusrbrown/systematic |
| Run ID | 25658621158 |
| Cache | hit |
| Session | ses_1e9e17368ffe8ExsUlvqo0Z8zo |
Why
PR #352 inverted Systematic's plugin registration model from a per-process singleton to per-load registration. The bootstrap marker regex in
src/index.tswas unchanged from prior versions, but CodeQL flagged it as polynomial-time ReDoS-vulnerable on the new branch. The regex hadn't moved; the trust boundary around it had — under the singleton it only saw plugin-authored content, but under per-load registration every plugin source can contribute fragments tooutput.systembefore the marker matcher runs.The lesson generalizes beyond this specific fix and is worth compounding: architectural changes that broaden the set of input authors can reclassify a previously safe regex as unsafe, even when the pattern itself is untouched. Worth a learning doc so the next inversion gets caught at design time, not at CodeQL time.
What
New compound doc at
docs/solutions/security-issues/redos-after-plugin-trust-boundary-inversion-2026-05-11.mdcapturing:findBootstrapMarkerBlockindexOf/slicehelper with before/after codeO(n+m)substring search vsO(n²)regex backtracking on adversarial inputs; secondary benefits (no$&/$1interpolation hazard, more legible semantics)Discoverability
AGENTS.mdline 55 already describesdocs/solutions/accurately. No instruction-file edit needed — the knowledge store surfaces to fresh agents.Validation
problem_type: security_issue→ bug track →category: security-issues/, all enum fields (component,severity,root_cause,resolution_type) match canonical valuesdocs/solutions/which is gate-excluded by design, but the gate ran anyway and stayed clean)docs/solutions/is not part of the Starlight content collection — no MDX parse risk from the<SYSTEMATIC_WORKFLOWS>literals in code examplesCreates a new
docs/solutions/security-issues/directory; no other category change.