Skip to content

Commit

Permalink
1.23.x changes to 2.0 (louislam#5457)
Browse files Browse the repository at this point in the history
  • Loading branch information
louislam authored Dec 20, 2024
2 parents c872929 + 4d16575 commit ccede11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/monitor-types/real-browser-monitor-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ class RealBrowserMonitorType extends MonitorType {
const context = await browser.newContext();
const page = await context.newPage();

// Prevent Local File Inclusion
// Accept only http:// and https://
// https://github.com/louislam/uptime-kuma/security/advisories/GHSA-2qgm-m29m-cj2h
let url = new URL(monitor.url);
if (url.protocol !== "http:" && url.protocol !== "https:") {
throw new Error("Invalid url protocol, only http and https are allowed.");
}

const res = await page.goto(monitor.url, {
waitUntil: "networkidle",
timeout: monitor.interval * 1000 * 0.8,
Expand Down

0 comments on commit ccede11

Please sign in to comment.