louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
52.8k stars 4.76k forks source link

Blank page in unexist statuspage slug #1451

Closed AnnAngela closed 2 years ago

AnnAngela commented 2 years ago

⚠️ Please verify that this bug has NOT been raised before.

🛡️ Security Policy

Description

Using master branch to start up dev backend & frontend server, made a monitor an a statuspage. Then open the statuspages, changed url in address bar to an unexist statuspage slug, the page went to blank.

image

👟 Reproduction steps

  1. Clone master branch.
  2. Run npm ci --dev.
  3. Run npm run start-server-dev.
  4. Run npm run dev.
  5. Open http://localhost:3000/.
  6. Create a monitor and a status page.
  7. Open the status page.
  8. Change the url in address bar to an unexist statuspage slug.

👀 Expected behavior

Something shows Page Not Found-like message.

😓 Actual Behavior

Blank page

🐻 Uptime-Kuma Version

1.14.0-beta.1

💻 Operating System and Arch

Windows 10 Pro 21H2 x64 19044.1620

🌐 Browser

Microsoft Edge Dev x64 101.0.1210.2

🐋 Docker Version

N/A

🟩 NodeJS Version

v16.13.0

📝 Relevant log output

Both servers shows nothing.
AnnAngela commented 2 years ago

I figured out that this axios request doesn't handle error. Maybe this is the point.

louislam commented 2 years ago

In deep, most non-existing resources are unhandled currently, may plan to review all vue routes later.

domingospanta commented 2 years ago

@louislam do you think this could be solved with something like this? https://forum.vuejs.org/t/best-practice-to-redirect-to-404-a-dynamic-route/35445

I saw that this happens with the dynamic routes only, any page not found next to the root path will show the default "PageNotFound" component.

Loqova commented 2 years ago

I'm using uptime-kuma as a Docker container which is accessed through a Caddy reverse_proxy. All works fine except the 404 related behavior as described in this issue.

I have some custom proxy behavior mainly for security concerns over multiple proxied applications like one default custom 404 page overwriting the application 404 and preventing unnecessary information leakage such as version numbers. This works fine with all my applications except with Uptime Kuma because it doesn't properly return 404 response status on non-existent resources.

This isn't limited to a non-existant status page slug as describe but broader to root/baseurl as well like /random.

Electrenator commented 1 year ago

It looks like the 404 status page is no longer displaying with an status pages which don't exists. The page is blank again within version 1.21.2 like this issue had described from last year