Search
Find a vulnerability
Search criteria
1 vulnerability found for Nightscout Web Monitor (aka. cgm-remote-monitor) by unknown
GCVE-1988-2026-0575
Vulnerability from gna-1988 – Published: 2026-11-17 19:38 – Updated: 2026-11-17 19:38
VLAI
EPSS
VEX
Title
Nightscout < 15.0.8: Stored XSS via WebSocket Treatment Writes (GHSA-5mrq-gpqw-q5v5)
Summary
=========================================================================
Product: Nightscout Web Monitor (aka. cgm-remote-monitor)
Repository: https://github.com/nightscout/cgm-remote-monitor
Vulnerability: CWE-79
(Improper Neutralization of Input During Web Page
Generation)
Affected: >= 0.8.1, < 15.0.8
Fixed: 15.0.8
Severity: Critical
GHSA: GHSA-5mrq-gpqw-q5v5
CVE: Awaiting assignment
CVSS v4.0: AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N
1. Product Description
----------------------
Nightscout is an open-source web application for displaying and sharing
continuous glucose monitoring (CGM) data. It can integrate data from
CGMs, insulin pumps, automated insulin delivery systems, and related
diabetes-management software.
Nightscout installations may contain sensitive health and
medical-device information, including glucose measurements, insulin
delivery information, treatment records, insulin-pump status, and
telemetry generated by automated insulin delivery systems.
The project is maintained at:
https://github.com/nightscout/cgm-remote-monitor
2. Summary
----------
Nightscout contains a stored cross-site scripting vulnerability in the
handling and display of treatment records written through its main
Socket.IO connection.
An authenticated client with permission to create or modify treatments
can store unsanitised HTML in treatment fields such as 'notes' or
'enteredBy'. When another user hovers over the affected treatment in
the Nightscout dashboard, the treatment tooltip inserts these fields
into the page as HTML.
Attacker-controlled JavaScript can consequently execute in the
Nightscout origin with the permissions and authenticated context of the
user viewing the malicious treatment.
3. Details
----------
Nightscout exposes treatment write operations through its main
Socket.IO connection. A client with the required treatment permissions
can use the 'dbAdd' event to create a treatment containing
attacker-controlled values.
The minimum relevant permission scopes for the demonstrated attack are:
api:treatments:create
api:treatments:delete
api:treatments:update
Nightscout's REST treatment creation path sanitizes submitted objects
before storing them. The corresponding WebSocket treatment write path,
however, writes treatment objects without passing them through the same
purification process.
The affected WebSocket handling is located in:
'lib/server/websocket.js'
The stored treatment is later displayed by client-side rendering code
in:
'lib/client/renderer.js'
Treatment tooltip rendering inserts fields including 'notes' and
'enteredBy' into the document using '.html()'. As a result, HTML stored
through the WebSocket write path is interpreted as markup rather than
displayed as text.
The combination of an unsanitized WebSocket write path and an HTML
rendering sink therefore creates a persistent cross-site scripting
condition.
4. Impact
---------
An authenticated attacker with treatment write permissions can create
a treatment containing malicious HTML or JavaScript.
The payload is stored by Nightscout and subsequently delivered to other
users viewing the affected treatment. When a user triggers the
treatment tooltip, attacker-controlled JavaScript executes within that
user's Nightscout origin.
The injected script executes in the authenticated browser context of
the victim rather than with only the attacker's original treatment
permissions. As a result, the script can interact with Nightscout using
the permissions available to the victim.
If the victim has elevated or administrative permissions, this may
allow the attacker-controlled script to perform privileged Nightscout
operations available to that user, including modification of treatment
data or other administrative actions exposed to the authenticated
client.
The vulnerability therefore permits privilege escalation from a client
with treatment write access to actions available through the session of
a more highly privileged user who views the malicious treatment.
5. Proof of Concept
-------------------
The following proof of concept uses an existing authenticated Nightscout
browser session. The client must have the treatment permissions required
to create the malicious treatment.
(() => {
const c = window.Nightscout?.client;
if (!c?.socket?.connected) {
throw new Error("Nightscout connection unavailable.");
}
c.socket.emit("authorize", {
client: "web",
secret: c.authorized?.token ? null : c.hashauth.hash(),
token: c.authorized?.token
}, console.log);
const marker = `NS-XSS-POC-${Date.now()}`;
const payload =
`<img src="data:image/gif;base64,` +
`R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==" ` +
`onload="document.title='${marker}'">`;
c.socket.emit("dbAdd", {
collection: "treatments",
data: {
eventType: "Note",
created_at: new Date(Date.now() - 300000).toISOString(),
duration: 10,
enteredBy: "PoC",
notes: payload
}
}, (res) => {
const id = res?.[0]?._id;
if (!id) return console.error("Failed:", res);
localStorage.setItem("nsXssPocId", id);
console.log("Created PoC:", { id, marker });
location.reload();
});
})();
The proof of concept stores an image element whose 'onload' handler
changes the document title. This provides a visible demonstration of
JavaScript execution without performing privileged Nightscout actions.
After the treatment has been stored and the page reloaded, hovering
over the malicious treatment causes the payload to execute.
6. Affected Versions
--------------------
Nightscout versions >= 0.8.1 and < 15.0.8 are affected.
The vulnerable behaviour results from the combination of the WebSocket
treatment write path accepting unsanitized treatment fields and the
client-side treatment tooltip rendering those fields as HTML.
Nightscout 15.0.8 contains the fix.
7. Remediation
--------------
Users should update to Nightscout 15.0.8 or later, which contains the
fix for this vulnerability.
The fix prevents treatment data written through the affected WebSocket
path from reaching an executable HTML rendering context without
appropriate sanitization.
Users should upgrade even where treatment write access is restricted,
as exploitation requires only treatment write permissions and the
stored payload may subsequently execute in the browser of a more
privileged Nightscout user.
8. Workaround
-------------
Upgrading to Nightscout 15.0.8 or later is the recommended remediation.
If an affected installation cannot be upgraded immediately, operators
should restrict treatment write permissions to trusted users and
clients until the upgrade can be completed.
This reduces exposure but does not correct the underlying discrepancy
between the WebSocket treatment write path and treatment rendering, and
should not be treated as a substitute for upgrading.
9. CVSS
-------
Severity: Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N
Attack vector: Network
Attack complexity: Low
Attack requirements: None
Privileges required: Low
User interaction: Passive
Vulnerable system: High confidentiality and integrity impact; no
availability impact.
Subsequent system: High confidentiality and integrity impact; no
availability impact.
10. References
-------------
Research report:
https://www.scstudios.tech/research/GHSA-5mrq-gpqw-q5v5
Nightscout:
https://github.com/nightscout/cgm-remote-monitor
GitHub Security Advisory:
https://github.com/nightscout/cgm-remote-monitor/security/advisories/
GHSA-5mrq-gpqw-q5v5
CWE-79:
https://cwe.mitre.org/data/definitions/79.html
Fix:
https://github.com/nightscout/cgm-remote-monitor/pull/8591
Fixed release:
https://github.com/nightscout/cgm-remote-monitor/releases/tag/v15.0.8
10. Timeline
------------
2026-09-01 Vulnerability privately reported to a Nightscout maintainer,
with a proof of concept and a demonstration video.
2026-09-02 Private GitHub security report GHSA-5mrq-gpqw-q5v5 submitted.
A temporary private fork was created for the report.
2026-09-02 Fix merged in PR #8591 (20:20 UTC, 3 September in Hobart).
2026-09-04 Nightscout 15.0.8 released containing the fix (18:27 UTC,
5 September in Hobart).
2026-09-06 Reporter requested that the advisory be accepted as a draft
and reported submitting a CVE request to MITRE.
2026-09-17 Reporter notified the maintainer of an intention to publish
a technical disclosure that week and invited objections.
2026-09-19 Maintainer accepted the GitHub security report.
2026-09-22 Reporter joined the Nightscout security team and requested
a CVE through GitHub.
2026-09-26 CVE request repeated through GitHub. Further requests were
made during October; no CVE ID had been assigned at the
time of preparing this disclosure.
2026-10-30 Reporter followed up with the maintainer about publication
of the disclosure, noting that the fix was in 15.0.8.
2026-11-13 Maintainer acknowledged the proposed coordinated
publication of the disclosure and GHSA.
2026-11-16 Public disclosure and publication.
--
Ruben Sutton
Software Developer & Security Researcher
SuperCode Studios
https://www.scstudios.tech/
PGP: FE673 AD759 DC01A 264DC 933FD 4B425 66BB8 B28FA_______________________________________________
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: https://seclists.org/fulldisclosure/
Severity
No CVSS data available.
CWE
Assigner
References
11 references
Impacted products
1 product
| Vendor | Product | Version | |
|---|---|---|---|
| unknown | Nightscout Web Monitor (aka. cgm-remote-monitor) |
Affected:
unknown
|
{
"containers": {
"cna": {
"affected": [
{
"product": "Nightscout Web Monitor (aka. cgm-remote-monitor)",
"vendor": "unknown",
"versions": [
{
"status": "affected",
"version": "unknown"
}
]
}
],
"credits": [
{
"lang": "en",
"type": "finder",
"value": "Ruben Sutton via Fulldisclosure"
}
],
"descriptions": [
{
"lang": "en",
"value": "=========================================================================\n\nProduct: Nightscout Web Monitor (aka. cgm-remote-monitor)\nRepository: https://github.com/nightscout/cgm-remote-monitor\nVulnerability: CWE-79\n (Improper Neutralization of Input During Web Page\n Generation)\nAffected: \u003e= 0.8.1, \u003c 15.0.8\nFixed: 15.0.8\nSeverity: Critical\nGHSA: GHSA-5mrq-gpqw-q5v5\nCVE: Awaiting assignment\nCVSS v4.0: AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N\n\n1. Product Description\n----------------------\nNightscout is an open-source web application for displaying and sharing\ncontinuous glucose monitoring (CGM) data. It can integrate data from\nCGMs, insulin pumps, automated insulin delivery systems, and related\ndiabetes-management software.\n\nNightscout installations may contain sensitive health and\nmedical-device information, including glucose measurements, insulin\ndelivery information, treatment records, insulin-pump status, and\ntelemetry generated by automated insulin delivery systems.\n\nThe project is maintained at:\n\nhttps://github.com/nightscout/cgm-remote-monitor\n\n2. Summary\n----------\nNightscout contains a stored cross-site scripting vulnerability in the\nhandling and display of treatment records written through its main\nSocket.IO connection.\n\nAn authenticated client with permission to create or modify treatments\ncan store unsanitised HTML in treatment fields such as \u0027notes\u0027 or\n\u0027enteredBy\u0027. When another user hovers over the affected treatment in\nthe Nightscout dashboard, the treatment tooltip inserts these fields\ninto the page as HTML.\n\nAttacker-controlled JavaScript can consequently execute in the\nNightscout origin with the permissions and authenticated context of the\nuser viewing the malicious treatment.\n\n3. Details\n----------\nNightscout exposes treatment write operations through its main\nSocket.IO connection. A client with the required treatment permissions\ncan use the \u0027dbAdd\u0027 event to create a treatment containing\nattacker-controlled values.\n\nThe minimum relevant permission scopes for the demonstrated attack are:\n\napi:treatments:create\napi:treatments:delete\napi:treatments:update\n\nNightscout\u0027s REST treatment creation path sanitizes submitted objects\nbefore storing them. The corresponding WebSocket treatment write path,\nhowever, writes treatment objects without passing them through the same\npurification process.\n\nThe affected WebSocket handling is located in:\n\n\u0027lib/server/websocket.js\u0027\n\nThe stored treatment is later displayed by client-side rendering code\nin:\n\n\u0027lib/client/renderer.js\u0027\n\nTreatment tooltip rendering inserts fields including \u0027notes\u0027 and\n\u0027enteredBy\u0027 into the document using \u0027.html()\u0027. As a result, HTML stored\nthrough the WebSocket write path is interpreted as markup rather than\ndisplayed as text.\n\nThe combination of an unsanitized WebSocket write path and an HTML\nrendering sink therefore creates a persistent cross-site scripting\ncondition.\n\n4. Impact\n---------\nAn authenticated attacker with treatment write permissions can create\na treatment containing malicious HTML or JavaScript.\n\nThe payload is stored by Nightscout and subsequently delivered to other\nusers viewing the affected treatment. When a user triggers the\ntreatment tooltip, attacker-controlled JavaScript executes within that\nuser\u0027s Nightscout origin.\n\nThe injected script executes in the authenticated browser context of\nthe victim rather than with only the attacker\u0027s original treatment\npermissions. As a result, the script can interact with Nightscout using\nthe permissions available to the victim.\n\nIf the victim has elevated or administrative permissions, this may\nallow the attacker-controlled script to perform privileged Nightscout\noperations available to that user, including modification of treatment\ndata or other administrative actions exposed to the authenticated\nclient.\n\nThe vulnerability therefore permits privilege escalation from a client\nwith treatment write access to actions available through the session of\na more highly privileged user who views the malicious treatment.\n\n5. Proof of Concept\n-------------------\nThe following proof of concept uses an existing authenticated Nightscout\nbrowser session. The client must have the treatment permissions required\nto create the malicious treatment.\n\n\n (() =\u003e {\n const c = window.Nightscout?.client;\n if (!c?.socket?.connected) {\n throw new Error(\"Nightscout connection unavailable.\");\n }\n\n c.socket.emit(\"authorize\", {\n client: \"web\",\n secret: c.authorized?.token ? null : c.hashauth.hash(),\n token: c.authorized?.token\n }, console.log);\n\n const marker = `NS-XSS-POC-${Date.now()}`;\n const payload =\n `\u003cimg src=\"data:image/gif;base64,` +\n `R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==\" ` +\n `onload=\"document.title=\u0027${marker}\u0027\"\u003e`;\n\n c.socket.emit(\"dbAdd\", {\n collection: \"treatments\",\n data: {\n eventType: \"Note\",\n created_at: new Date(Date.now() - 300000).toISOString(),\n duration: 10,\n enteredBy: \"PoC\",\n notes: payload\n }\n }, (res) =\u003e {\n const id = res?.[0]?._id;\n if (!id) return console.error(\"Failed:\", res);\n\n localStorage.setItem(\"nsXssPocId\", id);\n console.log(\"Created PoC:\", { id, marker });\n location.reload();\n });\n })();\n\nThe proof of concept stores an image element whose \u0027onload\u0027 handler\nchanges the document title. This provides a visible demonstration of\nJavaScript execution without performing privileged Nightscout actions.\n\nAfter the treatment has been stored and the page reloaded, hovering\nover the malicious treatment causes the payload to execute.\n\n6. Affected Versions\n--------------------\nNightscout versions \u003e= 0.8.1 and \u003c 15.0.8 are affected.\n\nThe vulnerable behaviour results from the combination of the WebSocket\ntreatment write path accepting unsanitized treatment fields and the\nclient-side treatment tooltip rendering those fields as HTML.\n\nNightscout 15.0.8 contains the fix.\n\n7. Remediation\n--------------\nUsers should update to Nightscout 15.0.8 or later, which contains the\nfix for this vulnerability.\n\nThe fix prevents treatment data written through the affected WebSocket\npath from reaching an executable HTML rendering context without\nappropriate sanitization.\n\nUsers should upgrade even where treatment write access is restricted,\nas exploitation requires only treatment write permissions and the\nstored payload may subsequently execute in the browser of a more\nprivileged Nightscout user.\n\n8. Workaround\n-------------\nUpgrading to Nightscout 15.0.8 or later is the recommended remediation.\n\nIf an affected installation cannot be upgraded immediately, operators\nshould restrict treatment write permissions to trusted users and\nclients until the upgrade can be completed.\n\nThis reduces exposure but does not correct the underlying discrepancy\nbetween the WebSocket treatment write path and treatment rendering, and\nshould not be treated as a substitute for upgrading.\n\n9. CVSS\n-------\nSeverity: Critical\n\nCVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N\n\nAttack vector: Network\nAttack complexity: Low\nAttack requirements: None\nPrivileges required: Low\nUser interaction: Passive\nVulnerable system: High confidentiality and integrity impact; no\navailability impact.\nSubsequent system: High confidentiality and integrity impact; no\navailability impact.\n\n10. References\n-------------\nResearch report:\nhttps://www.scstudios.tech/research/GHSA-5mrq-gpqw-q5v5\n\nNightscout:\nhttps://github.com/nightscout/cgm-remote-monitor\n\nGitHub Security Advisory:\nhttps://github.com/nightscout/cgm-remote-monitor/security/advisories/\nGHSA-5mrq-gpqw-q5v5\n\nCWE-79:\nhttps://cwe.mitre.org/data/definitions/79.html\n\nFix:\nhttps://github.com/nightscout/cgm-remote-monitor/pull/8591\n\nFixed release:\nhttps://github.com/nightscout/cgm-remote-monitor/releases/tag/v15.0.8\n\n10. Timeline\n------------\n2026-09-01 Vulnerability privately reported to a Nightscout maintainer,\n with a proof of concept and a demonstration video.\n\n2026-09-02 Private GitHub security report GHSA-5mrq-gpqw-q5v5 submitted.\n A temporary private fork was created for the report.\n\n2026-09-02 Fix merged in PR #8591 (20:20 UTC, 3 September in Hobart).\n\n2026-09-04 Nightscout 15.0.8 released containing the fix (18:27 UTC,\n 5 September in Hobart).\n\n2026-09-06 Reporter requested that the advisory be accepted as a draft\n and reported submitting a CVE request to MITRE.\n\n2026-09-17 Reporter notified the maintainer of an intention to publish\n a technical disclosure that week and invited objections.\n\n2026-09-19 Maintainer accepted the GitHub security report.\n\n2026-09-22 Reporter joined the Nightscout security team and requested\n a CVE through GitHub.\n\n2026-09-26 CVE request repeated through GitHub. Further requests were\n made during October; no CVE ID had been assigned at the\n time of preparing this disclosure.\n\n2026-10-30 Reporter followed up with the maintainer about publication\n of the disclosure, noting that the fix was in 15.0.8.\n\n2026-11-13 Maintainer acknowledged the proposed coordinated\n publication of the disclosure and GHSA.\n\n2026-11-16 Public disclosure and publication.\n\n--\nRuben Sutton\nSoftware Developer \u0026 Security Researcher\nSuperCode Studios\nhttps://www.scstudios.tech/\nPGP: FE673 AD759 DC01A 264DC 933FD 4B425 66BB8 B28FA_______________________________________________\nSent through the Full Disclosure mailing list\nhttps://nmap.org/mailman/listinfo/fulldisclosure\nWeb Archives \u0026 RSS: https://seclists.org/fulldisclosure/"
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-79",
"description": "CWE-79",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-11-17T19:38:27Z",
"orgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
"shortName": "VULNARCHIVE"
},
"references": [
{
"tags": [
"technical-description",
"exploit"
],
"url": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/37"
},
{
"tags": [
"technical-description"
],
"url": "https://seclists.org/fulldisclosure/2026/Nov/37"
},
{
"url": "https://cwe.mitre.org/data/definitions/79.html"
},
{
"url": "https://github.com/nightscout/cgm-remote-monitor"
},
{
"url": "https://github.com/nightscout/cgm-remote-monitor/pull/8591"
},
{
"url": "https://github.com/nightscout/cgm-remote-monitor/releases/tag/v15.0.8"
},
{
"url": "https://github.com/nightscout/cgm-remote-monitor/security/advisories/"
},
{
"url": "https://nmap.org/mailman/listinfo/fulldisclosure"
},
{
"url": "https://seclists.org/fulldisclosure/"
},
{
"url": "https://www.scstudios.tech/"
},
{
"url": "https://www.scstudios.tech/research/GHSA-5mrq-gpqw-q5v5"
}
],
"source": {
"defect": [
"https://seclists.org/fulldisclosure/2026/Nov/37"
],
"discovery": "EXTERNAL"
},
"title": "Nightscout \u003c 15.0.8: Stored XSS via WebSocket Treatment Writes (GHSA-5mrq-gpqw-q5v5)",
"x_gcve": [
{
"recordType": "advisory",
"relationships": [],
"vulnId": "GCVE-1988-2026-0575",
"x_vulnarchive": {
"archiveUrl": "https://vuln.freearchive.org/archive/full-disclosure/2026/Nov/37",
"automated": true,
"contentSha256": "cc386616d144583d7116907c27feb013da52625fb0d4d91a155bcdc505c04475",
"evidenceScore": 11,
"messageId": "",
"originalUrl": "https://seclists.org/fulldisclosure/2026/Nov/37",
"policy": "vulnarchive-1",
"sourceFormat": "text/html",
"sourcePublishedAt": "2026-11-16T00:22:01Z"
}
}
]
}
},
"cveMetadata": {
"assignerOrgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
"assignerShortName": "VULNARCHIVE",
"datePublished": "2026-11-17T19:38:27Z",
"dateUpdated": "2026-11-17T19:38:27Z",
"state": "PUBLISHED",
"vulnId": "GCVE-1988-2026-0575"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2"
}