The renderPairingPage() function embeds the error parameter directly into HTML without escaping:
const errorHtml = error ? `<p style="color:#e74c3c">${error}</p>` : "";
All current call sites pass hardcoded strings, so this is not exploitable today. However, the function is architecturally fragile — if a future code change passes user-controlled or dynamic content into the error parameter, it would create an XSS vulnerability.
The renderAuthorizePage() function in the same file correctly uses escapeHtml() for dynamic content, making this an inconsistency.
Affected code:
packages/server/src/index.ts:64-89 — renderPairingPage() with unescaped error interpolationpackages/server/src/index.ts:130 — renderAuthorizePage() correctly uses escapeHtml()v0.70.1
Fix: Apply escapeHtml() to the error parameter:
const errorHtml = error ? `<p style="color:#e74c3c">${escapeHtml(error)}</p>` : "";
No workaround needed — all current callers pass hardcoded strings.
packages/server/src/index.ts{
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-25T17:15:40Z",
"nvd_published_at": null,
"severity": "LOW"
}