Junglewise Threat Intelligence

Grackle Server unescaped error string in HTML template

Severity: medium · CVSS 4 · Published 2026-03-25

Technologies: @grackle-ai/server (npm). Vendors: npm.

Executive brief

The @grackle-ai/server package contains a weakness in its pairing page HTML rendering function where user-supplied error messages are not properly escaped before being inserted into web pages. While all current code paths use hardcoded error strings and are not exploitable today, this architectural fragility creates a risk that future code changes could introduce reflected cross-site scripting (XSS) attacks, allowing attackers to inject malicious scripts into the browser. Similar code in the same file correctly escapes such content, indicating this is an inconsistency rather than intentional design.

Technical details

The vulnerability is a Stored/Reflected XSS (CWE-79) in the renderPairingPage() function at packages/server/src/index.ts:64-89. The error parameter is directly interpolated into an HTML template without HTML entity escaping: `${error}` instead of `${escapeHtml(error)}`. Attack vector requires network access to the affected web interface and user interaction (clicking a crafted link). Currently not exploitable because all call sites pass hardcoded strings, but the code is fragile—any future refactoring that passes user-controlled or dynamic content through the error parameter would create an XSS vulnerability. The patch (v0.70.1) applies escapeHtml() to the error parameter, consistent with the correctly implemented renderAuthorizePage() function in the same file. No known public exploits exist.

Affected products

  • Grackle @grackle-ai/server <= 0.70.0

Timeline

  • 2026-03-25: disclosed

References

Related threats