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 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. Start Uptime Kuma: docker run -d -p 3001:3001 -v uptime-kuma:/app/data –name uptime-kuma louislam/uptime-kuma:1 Create a user using the Uptime Kuma web interface, e.g. user admin with password admin123 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 Create file poc.js with the…Read More
Uptime Kuma vulnerable to authenticated remote code execution via malicious plugin installation

