/

CVE-2026-103931

Severity:

HIGH RISK

(8.7)

Cross-Site Scripting (CWE-79) in Instatic URL Sanitizer

CVE-2026-103931

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Script execution in the same-origin admin context

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Instatic's URL sanitization can leave certain leading control characters that browsers discard when parsing a URL scheme. A low-privileged editor may be able to use this gap to cause script execution when an Owner or Admin activates the affected content in the same-origin editor canvas.

Affected context

The issue occurs in Instatic's shared URL sanitization and property escaping paths when URL properties or custom HTML attributes are rendered. It is risky when an editor can add affected content and an Owner or Admin activates that element in the same-origin admin editor canvas.

Exploit preconditions

  • Attack surface: URL properties or custom HTML attributes rendered by Instatic
  • Required access: A low-privileged editor account able to add or modify content
  • Trigger point: An Owner or Admin activates the affected element in the same-origin admin editor canvas
  • Why exploitation is possible: The sanitizer leaves some leading C0 control characters that the browser discards before parsing the URL scheme, allowing a dangerous URL to be interpreted differently by the browser.

Why this happens

The URL sanitizer removes some whitespace and control characters but does not account for all leading C0 controls that browsers ignore during URL parsing. This mismatch allows content that passes sanitization to be interpreted as an executable URL by the browser.

The failure to safely sanitize untrusted content before rendering maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

Potential impact

  • Script execution could occur with the victim administrator's application authority.
  • An attacker may be able to use admin APIs to access protected data.
  • An attacker could potentially create an owner account or install a plugin.

General mitigation guidance

Defensive patterns focus on ensuring URL validation and browser interpretation agree, and on limiting the authority of rendered content.

  • Use secure-by-default URL handling that rejects or normalizes all browser-ignored leading control characters before scheme validation.
  • Allowlist permitted URL schemes and reject unexpected or ambiguous forms.
  • Apply context-appropriate output encoding and HTML sanitization to URL properties and custom attributes.
  • Reduce trust in editor-provided content and limit which users can create or activate rich content.
  • Apply least privilege to administrative functions and restrict sensitive actions behind appropriate authorization checks.

How teams detect issues like this

  • Use static analysis to identify URL sanitizers that remove only selected whitespace or control characters before checking schemes.
  • Review rendering paths for URL properties and custom HTML attributes, including shared sanitizers and escaping helpers.
  • Test URL validation against browser parsing behavior, including leading control characters and unusual whitespace.
  • Enforce code-review or CI policies requiring scheme allowlisting and safe handling of user-controlled HTML and URLs.
  • Automated code review tools may help identify inconsistent sanitization and rendering patterns.

Sources

SourceLink
github.comgithub.com/CoreBunch/Instatic/commit/d97cac231e759d5ca445617193e53243d970b629
github.comgithub.com/CoreBunch/Instatic/pull/275
github.comgithub.com/CoreBunch/Instatic/releases/tag/v0.0.14
github.comgithub.com/CoreBunch/Instatic/security/advisories/GHSA-pqcp-872g-gmp8

Frequently asked

questions

Exploitation depends on content being rendered and activated in the same-origin admin editor canvas; it is not described as affecting every page view.

The described scenario requires a low-privileged editor account that can add or modify the relevant URL property or custom HTML attribute. An Owner or Admin must then activate the element in the editor canvas.

Normalize or reject browser-ignored leading controls before validating URLs, allowlist acceptable schemes, and sanitize and encode content for its rendering context.

Treat editor content as untrusted, test sanitization against browser URL parsing behavior, and enforce code-review and CI policies for URL and HTML handling.

Find out what's already
exploitable in your codebase.