Instatic: Stored XSS via URL sanitization bypass (CVE-2026-103931)
An incomplete URL sanitization routine in the Instatic isSafeUrl() function allows stored Cross-Site Scripting (XSS) via leading C0 control characters, enabling low-privileged users to achieve administrative account compromise.
CVE search metadata
CVE search record: CVE-2026-103931. KEV: no. Product: Instatic (<= 0.0.13). Brief: Instatic: Stored XSS via URL sanitization bypass (CVE-2026-103931). Brief link: https://feed.craftedsignal.io/briefs/2026-10-instatic-xss/
Triage facts
Revision 1- Applicability
- Instatic (<= 0.0.13)
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 2 public sources
- Freshness
- Revision 1Oct 25, 05:40 UTC
- Vulnerabilities
- 1 CVE
- Source quality
- B2Likely
Instatic version 0.0.13 and earlier are vulnerable to a Stored Cross-Site Scripting (XSS) vulnerability (CVE-2026-103931) within the isSafeUrl() function located in src/core/html-sanitize/index.ts. The sanitization logic fails to correctly filter C0 control characters (U+0000 - U+001F) when checking for malicious URL schemes such as javascript:, vbscript:, or data:. Browsers strip these leading control characters during URL parsing, allowing payloads to bypass the application's security filter and execute in the context of the admin editor's same-origin frame.
Attack Chain
- An attacker with 'Client' role privileges (or any role capable of editing page content) crafts a malicious URL payload using leading C0 control characters (e.g.,
\x01javascript:alert(document.domain)). - The payload is submitted via a link
href,imagesource, or custom HTML attribute field. - The
isSafeUrl()function attempts to normalize the input but fails to remove the specific C0 control characters, incorrectly marking the payload as "safe". - The malicious link is stored in the site content database.
- An administrator or owner opens the affected page within the admin editor canvas, which is an
srcdociframe sharing the same origin as the/adminapplication. - Because the admin interface lacks a strict
script-srcContent Security Policy (CSP), the browser executes thejavascript:payload within the admin origin upon interaction. - The payload executes with the privileges of the authenticated administrator, enabling session hijacking, account creation, or other malicious administrative actions.
Impact
Successful exploitation allows a low-privileged editor to escalate privileges to full administrative compromise by executing arbitrary JavaScript in the admin editor's origin. On published sites, the risk is dependent on the CSP; pages utilizing 'unsafe-inline' are vulnerable to execution of these filtered protocols.
Recommendation
- Upgrade Instatic to a version containing the fix that properly strips the full C0 and space range from URL inputs.
- Implement a strict
script-srcContent Security Policy (CSP) for the admin interface to prevent the execution of inline scripts andjavascript:protocol URLs. - Audit existing user-contributed content for links containing non-printable or unexpected control characters.
Immediate actions
Upgrade Instatic to a version patched against CVE-2026-103931
Threat Hunt
Search for stored link attributes or markdown containing non-printable C0 control characters (ASCII 0x01-0x1F) in the database.
Data: Database records of site content, specifically link hrefs and image sources
Mitigations
Restrict the admin interface with a strict Content Security Policy (CSP) blocking javascript: and unsafe-inline execution.
CVE-2026-103931