diff --git a/FIDELITY.md b/FIDELITY.md index 1d20521..f42f7a6 100644 --- a/FIDELITY.md +++ b/FIDELITY.md @@ -18,6 +18,15 @@ The committed PNGs under `testdata/renders/` back every claim here. Reproduce them with the commands at the bottom. The measured-vs-Chrome numbers live in [`bench/REPORT.md`](bench/REPORT.md). +## 2026-10-07 (round 166) — a script-built DOM tree far deeper than any real page crashed every whole-document tree walk with an unrecoverable stack overflow, not a panic (security audit, patch) + +Continuing this session's "audit de sécurité" pass after the rotate-crash fix below: checked for ReDoS and stack-overflow risk from pathological input. Go's `regexp` package is RE2-based (confirmed: every custom pattern in this repo — `svg.go`, `css/supports.go`, `css/selector.go`, `css/container.go`, `css/parse.go` — compiles under `regexp.MustCompile`, never a backtracking engine), so ReDoS is structurally impossible here, same category of finding as round 161's XXE check. Stack-overflow risk was real. + +- **Finding**: `golang.org/x/net/html` already refuses to *parse* markup nested past 512 levels (`html: open stack of elements exceeds 512 nodes`), so a page's raw HTML can never build a pathologically deep tree. But that guard lives in the parser alone — `dom.AppendChild`/`InsertBefore` have no depth check of their own, by design (they are generic tree-mutation primitives, not a parser), so a page's own `