AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: Unauthenticated shutdown endpoint allows local denial of service

未關閉
#1,241 7 則留言 0 個 reaction 已指派 1 人 已被 @Dotify71 認領 在 GitHub 檢視
backend question
主要語言
Python
星號
283
分支
679
平均合併
7 天 2 小時
30 天內合併 PR
3

描述

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

Unauthenticated shutdown endpoints can be triggered locally and cause immediate denial of service.

Both backend and sync microservice expose POST /shutdown without authentication, token validation, or trusted-caller checks. Any local process that can send HTTP requests to localhost can terminate one or both services.

Reproduction:

- Start PictoPy normally.
- Send POST request to backend shutdown endpoint on port 52123.
- Send POST request to sync microservice shutdown endpoint on port 52124.
- Observe service process exit.
- Expected behavior:
- Only trusted internal app logic should be able to shut down services.

Actual behavior:

- Any unauthenticated local caller can invoke shutdown and terminate processes.

Impact:

- High local DoS risk. Active indexing/sync operations can be interrupted and app reliability is degraded.

Suggested fix:

- Require authenticated shutdown secret or signed IPC command.
- Restrict shutdown actions to trusted caller context.
- Disable or harden HTTP shutdown routes in production builds.

### Record

- [x] I agree to follow this project's Code of Conduct

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。