Severity: 🟢 Low (correctness — not exploitable)
Location
src/ssr/head.ts:114-117.
Description
titleTemplate is applied with:
state.titleTemplate.replace(/%s/g, state.title)
Because state.title is used as the replacement string, special replacement patterns ($&, $1, $', $`) in the title are interpreted by String.prototype.replace and mangle the output. Not a security issue (the result is escapeText'd before emission), but a correctness bug — e.g. a page titled Q&A $& more renders incorrectly.
Suggested fix
Use a replacer function so the title is inserted literally:
state.titleTemplate.replace(/%s/g, () => state.title)
Filed as part of a full-codebase security & correctness audit.
Severity: 🟢 Low (correctness — not exploitable)
Location
src/ssr/head.ts:114-117.Description
titleTemplateis applied with:Because
state.titleis used as the replacement string, special replacement patterns ($&,$1,$',$`) in the title are interpreted byString.prototype.replaceand mangle the output. Not a security issue (the result isescapeText'd before emission), but a correctness bug — e.g. a page titledQ&A $& morerenders incorrectly.Suggested fix
Use a replacer function so the title is inserted literally:
Filed as part of a full-codebase security & correctness audit.