{"vuln_id":"GHSA-2qgm-m29m-cj2h","aliases":["CVE-2024-56331"],"description":"Local File Inclusion (LFI) via Improper URL Handling in `Real-Browser` monitor","published_at":"2024-12-20T14:23:08Z","modified_at":"2024-12-20T17:30:56Z","first_seen_at":"2026-11-22T13:40:14.916771Z","severity":"medium","severity_source":"ghsa","cvss_score":6.8,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N","cwe":[],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-2qgm-m29m-cj2h"},"matched_alias":null,"items":[{"id":12018,"source":{"id":"gh-uptime-kuma","name":"Uptime Kuma releases + advisories (GitHub louislam/uptime-kuma)"},"title":"GHSA-2qgm-m29m-cj2h / CVE-2024-56331: Local File Inclusion (LFI) via Improper URL Handling in `Real-Browser` monitor","summary":"Local File Inclusion (LFI) via Improper URL Handling in `Real-Browser` monitor ### Summary An **Improper URL Handling Vulnerability** allows an attacker to access sensitive local files on the server by exploiting the `file:///` protocol. This vulnerability is triggered via the **\"real-browser\"** request type, which takes a screenshot of the URL provided by the attacker. By supplying local file paths, such as `file:///etc/passwd`, an attacker can read sensitive data from the server. ### Details The vulnerability arises because the system does not properly validate or sanitize the user input for the URL field. Specifically: 1. The URL input (``) allows users to input arbitrary file paths, including those using the `file:///` protocol, without server-side validation. 2. The server then uses the user-provided URL to make a request, passing it to a browser instance that performs the \"real-browser\" request, which takes a screenshot of the content at the given URL. If a local file path is entered (e.g., `file:///etc/passwd`), the browser fetches and captures the file’s content. ```javascript const browser = await getBrowser(); const context = await browser.newContext(); const page = await context.newPage(); const res = await page.goto(monitor.url, { waitUntil: \"networkidle\", timeout: monitor.interval * 1000 * 0.8, }); let filename = jwt.sign(monitor.id, server.jwtSecret) + \".png\"; await page.screenshot({ path: path.join(Database.screenshotDir, filename), }); await context.close(); ``` Since the user input is not validated, an attacker can manipulate the URL to request local files (e.g., `file:///etc/passwd`), and the system will capture a screenshot of the file's content, potentially exposing sensitive data. ### PoC 1. **Instructions**: - Enter a local file path as the URL, such as: `view-source:file:///etc/passwd`. - The server will process the URL and, in \"real-browser\" mode, capture a screenshot of the file content. Example PoC: 1. Log in to the application with valid credentials: ```javascript const { io } = require(\"socket.io-client\"); // Server configuration and credentials const CONFIG = { serverUrl: \"ws://localhost:3001\", credentials: { username: \"admin\", password: \"password1\" }, requestType: { REAL_BROWSER: \"real-browser\", HTTP: \"http\" }, urlHeader: { VIEW_SOURCE: \"view-source:file:///\", FILE: \"file:///\" } }; // List of sensitive files on a Linux system const SENSITIVE_FILES = [ \"/etc/passwd\", \"/etc/shadow\", \"/etc/hosts\", \"/etc/hostname\", \"/etc/network/interfaces\", // May vary depending on the distribution \"/etc/ssh/ssh_config\", \"/etc/ssh/sshd_config\", \"~/.ssh/authorized_keys\", \"~/.ssh/id_rsa\", \"/etc/ssl/private/*.key\", \"/etc/ssl/certs/*.crt\", \"/app/data/kuma.db\", // Uptime Kuma database file \"/app/data/config.json\" // Uptime Kuma configuration file ] Affected packages: :uptime-kuma Patched: uptime-kuma 1.23.16, uptime-kuma 2.0.0-beta.1","url":"https://github.com/louislam/uptime-kuma/security/advisories/GHSA-2qgm-m29m-cj2h","published_at":"2024-12-20T14:23:08Z","updated_at":"2024-12-20T17:30:56Z","fetched_at":"2026-11-22T13:40:14.883736Z","severity":"medium","cvss_score":6.8,"epss":0.01845,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"louislam","product":"uptime-kuma","vuln_id":"CVE-2024-56331","vuln_ids":["CVE-2024-56331","GHSA-2QGM-M29M-CJ2H"],"tags":["repo-advisory","","security","repo:louislam/uptime-kuma"],"cluster_id":11322,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12018","html":"https://vulnwatch.ve1ve2.com/item/12018"}}]}