CVE-2024-56331 Overview
CVE-2024-56331 is a Local File Inclusion (LFI) vulnerability in Uptime Kuma, an open source, self-hosted monitoring tool. The vulnerability exists due to improper URL handling that allows an authenticated attacker to access sensitive local files on the server by exploiting the file:/// protocol through the "real-browser" request type functionality.
Critical Impact
Authenticated users can read arbitrary local files from the server (e.g., /etc/passwd) by abusing the screenshot functionality, leading to sensitive data exposure.
Affected Products
- Uptime Kuma versions prior to 1.23.16
Discovery Timeline
- December 20, 2024 - CVE-2024-56331 published to NVD
- December 20, 2024 - Last updated in NVD database
Technical Details for CVE-2024-56331
Vulnerability Analysis
This vulnerability is classified as CWE-22 (Path Traversal) and enables authenticated attackers to read sensitive local files from the server hosting Uptime Kuma. The attack is possible because the application fails to properly validate or sanitize user-supplied URL input before processing it through the browser screenshot feature.
The exploitation requires user interaction, as an attacker must be authenticated and manually submit a malicious URL. However, the scope is changed (cross-boundary impact), meaning the vulnerability affects resources beyond its security scope by allowing access to the underlying file system. The confidentiality impact is high, as attackers can exfiltrate sensitive server data.
Root Cause
The root cause of this vulnerability lies in insufficient server-side validation of URL input. The HTML input element accepts URLs with a pattern matching https?://.+, which appears to restrict input to HTTP/HTTPS protocols. However, this client-side validation is not enforced on the server side.
When a user submits a URL using the "real-browser" monitoring type, the application passes the URL directly to a browser instance that renders the content and captures a screenshot. Because there is no server-side validation blocking the file:/// protocol, the browser will happily render local file contents, which are then captured and returned to the attacker.
Attack Vector
The attack vector exploits the real-browser screenshot functionality in Uptime Kuma. An authenticated attacker can perform the following steps:
- Log into the Uptime Kuma dashboard
- Create a new monitor using the "real-browser" request type
- Supply a malicious URL such as file:///etc/passwd in the URL field
- Submit the monitor configuration
- The application's browser instance fetches and renders the local file content
- A screenshot containing the file contents is captured and displayed to the attacker
This allows attackers to read any file accessible to the user running the Uptime Kuma process, including configuration files, credentials, SSH keys, and other sensitive data stored on the server.
Detection Methods for CVE-2024-56331
Indicators of Compromise
- Monitor logs for URL submissions containing the file:/// protocol scheme
- Review Uptime Kuma monitor configurations for suspicious file path patterns
- Check for unusual screenshot requests targeting local system paths like /etc/passwd, /etc/shadow, or application configuration files
Detection Strategies
- Implement web application firewall (WAF) rules to detect and block file:/// protocol patterns in request parameters
- Monitor Uptime Kuma access logs for authenticated users creating monitors with non-HTTP/HTTPS URL schemes
- Deploy endpoint detection to identify browser processes reading sensitive system files unexpectedly
Monitoring Recommendations
- Enable verbose logging in Uptime Kuma to capture all monitor creation and modification events
- Set up alerts for any file access attempts by the Uptime Kuma process outside of expected directories
- Regularly audit monitor configurations for suspicious URL patterns
How to Mitigate CVE-2024-56331
Immediate Actions Required
- Upgrade Uptime Kuma to version 1.23.16 or later immediately
- Audit existing monitors for any suspicious file:/// URLs that may indicate prior exploitation
- Review Uptime Kuma logs for evidence of local file access attempts
- Consider restricting network access to the Uptime Kuma instance to trusted users only
Patch Information
The vulnerability has been addressed in Uptime Kuma version 1.23.16. The fix is available in the GitHub commit 6cfae01a0d3727c517afe512fc8fec1d99acf875. All users are strongly advised to upgrade to the patched version.
For additional details, refer to the GitHub Security Advisory GHSA-2qgm-m29m-cj2h.
Workarounds
- There are no known workarounds for this vulnerability according to the security advisory
- Until patching is possible, consider temporarily disabling the "real-browser" monitoring feature if your deployment allows
- Restrict access to the Uptime Kuma dashboard to only trusted administrative users
- Implement network segmentation to limit potential data exposure if exploitation occurs
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

