Skip to main content
Vulnerability Database/CVE-2026-105950

CVE-2026-105950: Formwork CMS XSS Vulnerability

CVE-2026-105950 is a cross-site scripting vulnerability in Formwork CMS that affects the URI sanitizer component. Attackers can exploit this flaw remotely to inject malicious scripts. This article covers technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-105950 Overview

CVE-2026-105950 is a cross-site scripting (XSS) vulnerability [CWE-79] affecting getformwork Formwork versions up to and including 2.3.12. The flaw resides in the DomSanitizer::sanitizeNodeAttribute function within formwork/src/Sanitizer/DomSanitizer.php, which is part of the URI Sanitizer component. The sanitizer fails to treat the formaction HTML attribute as a URI-bearing attribute, allowing attackers to inject script payloads that execute in the context of a victim's browser. The issue is remotely exploitable and requires low-privilege authentication combined with user interaction. Formwork maintainers addressed the issue in version 2.3.13 through commit 729701e59c5886685c5a1d477bdc3035e41f18b1.

Critical Impact

Authenticated attackers can inject JavaScript via the formaction attribute, enabling session theft, administrative action hijacking, and content manipulation within the Formwork panel.

Affected Products

  • getformwork Formwork versions up to and including 2.3.12
  • Component: DomSanitizer (formwork/src/Sanitizer/DomSanitizer.php)
  • Fixed version: Formwork 2.3.13

Discovery Timeline

  • 2026-10-06 - CVE-2026-105950 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-105950

Vulnerability Analysis

Formwork is a flat-file content management system written in PHP. Its DomSanitizer component is responsible for stripping unsafe URI schemes (such as javascript:) from attributes that accept URL values. The sanitizer enforces this policy by iterating over a predefined list of URI-bearing attributes in HtmlReference::URI_ATTRIBUTES.

The pre-patch allowlist omitted several HTML attributes that resolve URIs, most notably formaction. Because the sanitizer did not evaluate the formaction value, an attacker able to submit HTML content could supply a javascript: URI that executes when a form submission occurs. The injected script runs in the browser context of any user rendering the sanitized output, including administrators.

Root Cause

The root cause is an incomplete allowlist in the URI_ATTRIBUTES constant used by DomSanitizer::sanitizeNodeAttribute. Standard HTML permits formaction on <button> and <input type="submit"> elements to override a form's action URL. Because this attribute was absent from the allowlist, URI scheme filtering never ran against it, leaving a bypass for the sanitizer's XSS protections.

Attack Vector

An authenticated user with content-editing privileges submits HTML containing a <button formaction="javascript:..."> or <input type="submit" formaction="javascript:..."> element. When another user interacts with the rendered form, the attacker-controlled script executes with the victim's browser session. The attack requires network access to the Formwork panel and victim interaction with the malicious form control.

php
     */
    public const array URI_ATTRIBUTES = [
        'action',
-       'src',
+       'archive',
+       'background',
+       'cite',
+       'classid',
+       'codebase',
+       'data',
+       'formaction',
        'href',
+       'longdesc',
        'lowsrc',
-       'background',
+       'manifest',
        'ping',
+       'poster',
+       'src',
+       'usemap',
    ];
}

Source: GitHub Commit 729701e. The patch adds formaction and other URI-bearing attributes (archive, background, cite, classid, codebase, data, longdesc, manifest, poster, usemap) to the sanitizer's allowlist so URI scheme validation applies to each.

Detection Methods for CVE-2026-105950

Indicators of Compromise

  • HTML content persisted in Formwork pages or form definitions containing formaction="javascript:" or similarly encoded URI schemes.
  • Outbound requests from admin browsers to attacker-controlled domains following panel navigation events.
  • Unexpected modifications to Formwork user accounts, roles, or page content performed from administrator sessions.

Detection Strategies

  • Scan the Formwork content directory and database for stored HTML containing formaction, javascript:, data:text/html, or Base64-encoded script URIs.
  • Review web server access logs for POST requests to the Formwork admin API carrying payloads with formaction attributes.
  • Enable a Content Security Policy (CSP) in report-only mode to surface inline-script violations originating from stored content.

Monitoring Recommendations

  • Monitor Formwork panel authentication events for low-privilege accounts creating or editing content with embedded HTML.
  • Alert on administrator sessions issuing bulk changes shortly after rendering user-submitted content.
  • Forward web application logs to a centralized analytics platform and correlate panel edits with subsequent anomalous admin activity.

How to Mitigate CVE-2026-105950

Immediate Actions Required

  • Upgrade Formwork to version 2.3.13 or later, which includes the sanitizer fix in commit 729701e59c5886685c5a1d477bdc3035e41f18b1.
  • Audit existing pages, templates, and form definitions for stored HTML containing formaction or other URI-bearing attributes added in the patch.
  • Rotate session tokens and credentials for administrator accounts that may have viewed malicious content.

Patch Information

The fix is delivered in Formwork 2.3.13 via pull request #940. Review the GitHub Security Advisory GHSA-p78q-v3pr-p87j, the GitHub Release 2.3.13, and the GitHub Pull Request #940 for complete remediation details. The patch extends HtmlReference::URI_ATTRIBUTES to cover every HTML attribute that resolves a URI, ensuring the DomSanitizer applies URI scheme filtering uniformly.

Workarounds

  • Restrict content-editing privileges to trusted users until the upgrade is applied.
  • Deploy a strict Content Security Policy that disallows javascript: URIs and inline event handlers in the Formwork panel.
  • Add a web application firewall rule to block requests whose bodies contain formaction combined with javascript: or data: scheme prefixes.
bash
# Upgrade Formwork via Composer
composer require getformwork/formwork:^2.3.13

# Verify the installed version
php -r "echo file_get_contents('vendor/getformwork/formwork/composer.json');" | grep version

# Example CSP header to harden the admin panel
# Add to the web server configuration for the Formwork panel path
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'" always;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.