{"id":"GHSA-7q9x-8g6p-3x75","summary":"@grackle-ai/server: Unescaped Error String in renderPairingPage() HTML Template","details":"### Impact\n\nThe `renderPairingPage()` function embeds the `error` parameter directly into HTML without escaping:\n```typescript\nconst errorHtml = error ? `\u003cp style=\"color:#e74c3c\"\u003e${error}\u003c/p\u003e` : \"\";\n```\n\nAll 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.\n\nThe `renderAuthorizePage()` function in the same file correctly uses `escapeHtml()` for dynamic content, making this an inconsistency.\n\n**Affected code:**\n- `packages/server/src/index.ts:64-89` — `renderPairingPage()` with unescaped error interpolation\n- Compare: `packages/server/src/index.ts:130` — `renderAuthorizePage()` correctly uses `escapeHtml()`\n\n### Patches\n\nv0.70.1\n\n**Fix:** Apply `escapeHtml()` to the error parameter:\n```typescript\nconst errorHtml = error ? `\u003cp style=\"color:#e74c3c\"\u003e${escapeHtml(error)}\u003c/p\u003e` : \"\";\n```\n\n### Workarounds\n\nNo workaround needed — all current callers pass hardcoded strings.\n\n### Resources\n\n- CWE-79: Improper Neutralization of Input During Web Page Generation\n- File: `packages/server/src/index.ts`","modified":"2026-03-25T17:32:20.333636Z","published":"2026-03-25T17:15:40Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-03-25T17:15:40Z","nvd_published_at":null,"cwe_ids":["CWE-79"],"severity":"LOW"},"references":[{"type":"WEB","url":"https://github.com/nick-pape/grackle/security/advisories/GHSA-7q9x-8g6p-3x75"},{"type":"PACKAGE","url":"https://github.com/nick-pape/grackle"}],"affected":[{"package":{"name":"@grackle-ai/server","ecosystem":"npm","purl":"pkg:npm/%40grackle-ai/server"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.70.1"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 0.70.0","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-7q9x-8g6p-3x75/GHSA-7q9x-8g6p-3x75.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"}]}