# GHSA-vffh-c9pq-4crh: Uptime Kuma Server-side Template Injection (SSTI) in Notification Templates Allows Arbitrary File Read

> An authenticated user can exploit Server-side Template Injection in notification templates to read arbitrary files from the server.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 20 Oct 2025

## What is GHSA-vffh-c9pq-4crh?

GHSA-vffh-c9pq-4crh is a code injection vulnerability in uptime-kuma, published on 20 Oct 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

### Summary

In 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.

### Details

The 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:

```js
async renderTemplate(template, msg, monitorJSON, heartbeatJSON) {
    const engine = new Liquid();
    const parsedTpl = engine.parse(template);

    // ...
}
```

In some Notification flows, the `send()` implementation passes user-editable fields directly into `renderTemplate()`:
```js
// webhook.js
if (notification.webhookContentType === "form-data") {
    const formData = new FormData();
    formData.append("data", JSON.stringify(data));
    config.headers = formData.getHeaders();
    data = formData;
} else if (notification.webhookContentType === "custom") {
    data = await this.renderTemplate(notification.webhookCustomBody, msg, monitorJSON, heartbeatJSON); //<- this line cause SSTI
}
```

Because `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.

### PoC

1. Open Uptime Kuma → **Notifications** → **Add** or **Edit** an existing Webhook notification.
2. Set notification type to **Webhook** and set **Request Body**  to **Custom Body**.
3. Paste the following JSON into the custom request body:

```json
{
  "Title": {% render '/etc/passwd' %}
}
```

4. Click test.
5. Your webhook will receive the file content

### Impact

This is a post-authentication Server-side Template Injection (SSTI) vulnerability that allows an authenticated user to perform arbitrary file read on the server.

## Which versions are affected by GHSA-vffh-c9pq-4crh?

2 open source packages ship an affected version, including uptime-kuma.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `uptime-kuma` | npm | All versions | None |
| `uptime-kuma` | npm | All versions | None |

## How do I fix GHSA-vffh-c9pq-4crh?

No fix has been published for GHSA-vffh-c9pq-4crh yet. Limit exposure of the affected software until one is available.

## Is GHSA-vffh-c9pq-4crh being exploited?

There is no known exploitation of GHSA-vffh-c9pq-4crh in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-vffh-c9pq-4crh and fix it if it is affected.

What it is: GHSA-vffh-c9pq-4crh is a code injection vulnerability in uptime-kuma, published on 20 Oct 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-vffh-c9pq-4crh in the wild and no public exploit code.

Affected packages and fixed versions:
- uptime-kuma (npm): affected all versions; no fix listed
- uptime-kuma (npm): affected all versions; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-vffh-c9pq-4crh/ (Markdown: https://insights.sbomify.com/GHSA-vffh-c9pq-4crh/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-vffh-c9pq-4crh

---
From sbomify Insights: https://insights.sbomify.com/GHSA-vffh-c9pq-4crh/
Summaries are generated and may contain mistakes; the official description above is the record.
