< Up a Level

Security

Vulnerabilities disclosed 2026-11-17

Best mitigation: upgrade to code-input.js version 2.10.0 or later (for example, 2.10.1, 2.10.anything, 2.11.anything, 2.12.anything…). (If you want to keep an older version of code-input.js, I have backported the fix: upgrade to another of the fixed versions listed in the advisories below.) Other mitigations, workarounds, and details are linked below.

  1. Most likely to affect your code: Setting .value on a code-input element writes this value as unescaped HTML in some conditions, allowing DOM XSS. Click for more details in the GitHub Advisory.
  2. code-input.js characterLimit template (deprecated in v2.9.0) writes data-overflow-msg as unescaped HTML, allowing DOM XSS. Click for more details in the GitHub Advisory.
  3. code-input.js rainbowText template (deprecated in v2.9.0) writes color names and delimiters as unescaped HTML, allowing DOM XSS. Click for more details in the GitHub Advisory.

Reported by uc.surf security research (GitHub: ucsurf).

Reporting Security Vulnerabilities

If you find a sensitive security vulnerability in the code-input.js library, please email the maintainer Oliver Geer at security@webcoder49.dev, optionally using this encryption key. GitHub security advisories (different to the more general “issues”) are also accepted.

Threat Model

Except for the exception below, please report all security vulnerabilities in code-input.js and its code, that could arise in any plausible way of using the code-input.js library. This includes but is not limited to use with web frameworks, with Typescript, with and without ECMAScript Modules.

Security issues in the files under tests/ (that is not run by end users), if they would only arise by someone changing the test file’s contents, are not considered vulnerabilities.

Security issues under docs/ and tests/ directories, that could be construed as recommended usage of the code-input.js library, are considered vulnerabilities.