/

CVE-2026-22704

Severity:

HIGH RISK

(8.0)

Cross-Site Scripting (XSS) in HAX CMS Microsite Management

CVE-2026-22704

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored XSS leading to potential account takeover and session abuse

Severity:

HIGH RISK

(8.0)

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

HAX CMS versions 11.0.6 through before 25.0.0 contain a stored cross-site scripting vulnerability that allows malicious scripts to be persistently injected into microsites.

When a user later views the affected content in a browser, the attacker-controlled script can execute in the victim's session, which may enable actions like account takeover depending on the victim's privileges.

Affected context

The vulnerability occurs within HAX CMS microsites managed by PHP or Node.js backends where user-supplied content is stored and rendered back into web pages.

It is most relevant in areas that allow rich content editing, custom HTML-like input, or user-generated content that is later viewed by other authenticated users.

The issue exists when the application fails to consistently neutralize or encode untrusted input before it is stored and rendered in the browser, allowing attacker-controlled script content to persist in site data.

Exploit preconditions

  • Attack surface: Web-based HAX CMS interfaces that accept and display user-generated content (e.g., pages, posts, blocks, or microsite components).
  • Required access: Ability to create or modify content within a HAX CMS instance (which may be authenticated user access, contributor access, or any exposed content submission channel).
  • Trigger point: A victim user (such as an administrator, editor, or other logged-in user) visits a page or component containing the stored malicious payload in their browser.
  • Why exploitation is possible: Untrusted content is stored and later rendered without sufficient output encoding or HTML/script sanitization, enabling the browser to interpret attacker-supplied data as active JavaScript.

Why this happens

This vulnerability stems from improper neutralization of user input that is stored and subsequently delivered to clients as part of HTML responses.

Under CWE-79, stored XSS typically arises when applications treat user-controlled data as trusted markup or script, failing to apply strict output encoding or content sanitization at all rendering points.

In this context, certain HAX CMS views or components appear to render stored content directly into the DOM, allowing injected script or event handler attributes to execute in the security context of the affected site.

Potential impact

  • Hijacking of active user sessions and potential account takeover of users who view the malicious content.
  • Execution of arbitrary JavaScript in the victim's browser, including reading or modifying content within the page.
  • Unauthorized actions performed on behalf of the victim (e.g., changing configuration, creating new privileged accounts, or altering microsite content).
  • Theft of sensitive data accessible through the application UI, such as API tokens, CSRF tokens, or configuration details exposed in the front end.
  • Lateral movement within the CMS environment if administrative or high-privilege accounts are compromised.

General mitigation guidance

Effective mitigation focuses on enforcing strict separation between data and executable content, along with consistent output encoding.

Recommended defensive patterns include:

  • Applying robust output encoding for all untrusted data on every render path, tailored to the context (HTML body, attribute, URL, JavaScript, CSS).
  • Using a well-maintained HTML sanitization library for any rich content fields, configured to remove or neutralize script tags, event handlers, inline JavaScript URLs, and other active content.
  • Implementing a default-deny content policy: only allow a minimal, vetted subset of HTML tags and attributes in user-generated content.
  • Enforcing contextual escaping in server-side templates or client-side rendering logic, and avoiding string concatenation directly into the DOM.
  • Considering Content Security Policy (CSP) to reduce the impact of any remaining XSS vectors by disallowing inline scripts and restricting script sources.
  • Applying least-privilege principles for user roles so that compromise of a lower-privilege account has limited blast radius.

How teams detect issues like this

Detection generally combines code-level analysis with behavioral monitoring:

  • Static analysis: Use rules or linters to flag direct insertion of untrusted data into HTML or JavaScript contexts without proper encoding or sanitization, in both PHP and Node.js templating layers.
  • Code review: During manual reviews, pay close attention to areas handling rich text, WYSIWYG editors, Markdown/HTML fields, or any feature that stores and re-renders user input; verify that all outputs use standardized encoding helpers.
  • Security testing: Employ automated DAST tools and targeted penetration tests focused on content creation flows to identify persistent payloads that execute when viewed.
  • Runtime monitoring: Analyze logs and front-end error telemetry for suspicious script execution patterns, unusual DOM modifications, or requests initiated from unexpected pages or user accounts.
  • Policy enforcement: Integrate pre-commit or CI checks that enforce usage of approved encoding/sanitization utilities in the codebase and disallow ad-hoc DOM insertion APIs in front-end code.

Sources

SourceLink
github.comgithub.com/haxtheweb/haxcms-nodejs/commit/317a8ae29f88be389f7cfeffaef416957122d97e
github.comgithub.com/haxtheweb/haxcms-nodejs/releases/tag/v25.0.0
github.comgithub.com/haxtheweb/issues/security/advisories/GHSA-3fm2-xfq7-7778

Frequently asked

questions

Yes. If an attacker can reach any content submission surface in HAX CMS, they can attempt to inject a malicious payload that, once stored, will execute in the browser of any user who views the affected content.

Typically, the attacker needs the ability to create or modify content in the CMS, which may require a low-privileged authenticated account or access to any public content submission feature. Higher privileges are not strictly necessary if such a content path exists.

The most robust approach is to enforce contextual output encoding on every render path and to sanitize stored user content with a well-configured, allowlist-based HTML sanitizer. Centralizing encoding/sanitization logic and reusing trusted helper functions greatly reduces the risk of missed cases.

Adopt a secure development pattern that treats all user-supplied content as untrusted, uses framework-provided templating with automatic encoding, applies strict HTML sanitization for rich content, and augments this with security reviews, automated scanning for XSS patterns, and optional defenses like CSP and role-based access controls.

Find out what's already
exploitable in your codebase.