{"id":"GHSA-7q9x-8g6p-3x75","aliases":[],"status":"published","title":"@grackle-ai/server: Unescaped Error String in renderPairingPage() HTML Template","description":"### 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`","severity":{"version":"4.0","score":2.3,"vector":"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","level":"low","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2026-03-25T17:15:40Z","modified":"2026-03-25T17:32:20Z","fixes":[{"ecosystem":"npm","package":"@grackle-ai/server","fixed_in":["0.70.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@grackle-ai/server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.70.0"},{"fixed":"0.70.1"}]}]},{"source":"osv","ecosystem":"npm","package":"@grackle-ai/server","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.70.1"}]}]}],"references":[{"url":"https://github.com/nick-pape/grackle/security/advisories/GHSA-7q9x-8g6p-3x75","tags":["web"]},{"url":"https://github.com/advisories/GHSA-7q9x-8g6p-3x75"},{"url":"https://github.com/nick-pape/grackle","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-7q9x-8g6p-3x75","title":"@grackle-ai/server: Unescaped Error String in renderPairingPage() HTML Template","description":"### 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`","status":"published","published":"2026-03-25T17:15:40Z","modified":"2026-03-25T17:15:41Z","cvss":[{"version":"4.0","score":2.3,"vector":"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","level":"low"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:39:41.724707Z"}],"osv":[{"id":"GHSA-7q9x-8g6p-3x75","title":"@grackle-ai/server: Unescaped Error String in renderPairingPage() HTML Template","description":"### 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`","status":"published","published":"2026-03-25T17:15:40Z","modified":"2026-03-25T17:32:20.333636Z","cvss":[{"version":"4.0","score":2.3,"vector":"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","level":"low"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:41.349637Z"}]}}
